public static void Dispose(ContainerHandle container)
        {
            Tracing.Log(Tracing.Debug, "ContainerHandle.Dispose(id={0:x8})",
                        container.id);

            Thread.CurrentProcess.ReleaseHandle(container.id);
        }
        public static bool Create(out ContainerHandle container)
        {
            container = new ContainerHandle(Thread.CurrentProcess.AllocateHandle());

            Tracing.Log(Tracing.Debug, "ContainerHandle.Create(out id={0:x8})",
                        container.id);
            return(true);
        }
Beispiel #3
0
 public static unsafe bool CreateImpl(
     int threadIndex,
     ContainerHandle container,
     ThreadHandle *handle,
     UIntPtr *threadContext)
 {
     return(Create(threadIndex, container, out *handle,
                   out *threadContext));
 }
Beispiel #4
0
 public static bool Create(out ContainerHandle container)
 {
     unsafe
     {
         fixed(ContainerHandle *containerPtr = &container)
         {
             return(CreateImpl(containerPtr));
         }
     }
 }
Beispiel #5
0
        public static unsafe bool Create(int threadIndex,
                                         ContainerHandle container,
                                         out ThreadHandle handle,
                                         out UIntPtr threadContext)
        {
            bool ret = Thread.CurrentProcess.CreateThread(threadIndex, out handle, out threadContext);

            Tracing.Log(Tracing.Debug, "ThreadHandle.Create(index={0}, cont={1:x8}) = {2:x8}",
                        (UIntPtr) unchecked ((uint)threadIndex), container.id, handle.id);
            return(ret);
        }
Beispiel #6
0
 public static unsafe bool Create(int threadIndex,
                                  ContainerHandle container,
                                  out ThreadHandle thread,
                                  out UIntPtr threadContext)
 {
     fixed(ThreadHandle *threadPtr = &thread)
     {
         fixed(UIntPtr *threadContextPtr = &threadContext)
         {
             return(CreateImpl(threadIndex, container, threadPtr,
                               threadContextPtr));
         }
     }
 }
Beispiel #7
0
 public static unsafe extern bool CreateImpl(
     int threadIndex,
     ContainerHandle container,
     ThreadHandle *thread,
     UIntPtr *threadContext);
Beispiel #8
0
 public static extern void Dispose(ContainerHandle container);