dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Threading ThreadPool.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Threading ThreadPool.cs,1.2,1.3
Date: Thu, 03 Apr 2003 00:40:47 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading
In directory subversions:/tmp/cvs-serv30313/runtime/System/Threading

Modified Files:
        ThreadPool.cs 
Log Message:


Re-implement "NetworkStream" and "Socket".


Index: ThreadPool.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/ThreadPool.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ThreadPool.cs       2 Apr 2003 04:58:25 -0000       1.2
--- ThreadPool.cs       3 Apr 2003 05:40:44 -0000       1.3
***************
*** 106,109 ****
--- 106,128 ----
                        }
  
+       // Queue a new I/O completion item within the thread pool.
+       // This version is used by the "System" assembly in ECMA_COMPAT
+       // mode when "WaitCallback" is not defined.
+       internal static bool QueueCompletionItem
+                               (AsyncCallback callBack, IAsyncResult state)
+                       {
+                               lock(typeof(ThreadPool))
+                               {
+                                       if(completionWait == null)
+                                       {
+                                               completionWait = new Object();
+                                       }
+                               }
+                               AddCompletionItem
+                                       (new 
WorkItem(ClrSecurity.GetPermissionsFrom(1),
+                                        callBack, state));
+                               return true;
+                       }
+ 
        // Queue a new work item within the thread pool after dropping security.
        // This is "unsafe" in that it may elevate security permissions.
***************
*** 419,422 ****
--- 438,442 ----
                private WaitCallback callback;
                private WaitOrTimerCallback callback2;
+               private AsyncCallback callback3;
                private Object state;
                private int timeout;
***************
*** 434,437 ****
--- 454,465 ----
                                        this.state = state;
                                }
+               public WorkItem(ClrPermissions permissions,
+                                               AsyncCallback callback, Object 
state)
+                               {
+                                       this.permissions = permissions;
+                                       this.userWorkItem = true;
+                                       this.callback3 = callback;
+                                       this.state = state;
+                               }
                public WorkItem(ClrPermissions permissions, WaitHandle 
waitObject,
                                            WaitOrTimerCallback callback, 
Object state,
***************
*** 465,468 ****
--- 493,500 ----
                                                        {
                                                                callback(state);
+                                                       }
+                                                       else if(callback3 != 
null)
+                                                       {
+                                                               
callback3((IAsyncResult)state);
                                                        }
                                                }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]