Example #1
0
        /// <summary>
        /// Fiber method that executes the fiber action.
        /// </summary>
        /// <param name='lpParam'>Lp parameter.</param>
        /// <returns>fiber status code.</returns>
        private uint FiberRunnerProc(uint lpParam)
        {
            uint status = 0;

            try
            {
                action();
            }
            catch (Exception)
            {
                status = 1;
                throw;
            }
            finally
            {
                if (status == 1)
                {
                    UnmanagedFiberAPI.DeleteFiber((uint)Id);
                }
            }

            return(status);
        }
Example #2
0
 /// <summary>
 /// Deletes the fiber with the specified fiber id.
 /// </summary>
 /// <param name='fiberId'>fiber id.</param>
 public static void Delete(uint fiberId)
 {
     UnmanagedFiberAPI.DeleteFiber(fiberId);
 }
Example #3
0
 /// <summary>
 /// Deletes the current fiber.
 /// </summary>
 /// <remarks>This method should only be used in the fiber action that's executing.</remarks>
 public void Delete()
 {
     UnmanagedFiberAPI.DeleteFiber(Id);
 }