[corlib] Improve CancellationTokenSource test
[mono.git] / mcs / class / corlib / System.Threading / ChangeLog
1 2010-05-17 Gonzalo Paniagua Javier <gonzalo@novell.com>
2
3         * Timer.cs: check object reference when the timers are equal.
4         Fixes bug #605092.
5
6 2010-04-23  Rolf Bjarne Kvinge  <RKvinge@novell.com>
7
8         * LazyThreadSafetyMode.cs: Include in Moonlight build.
9
10 2010-04-15  Jérémie Laval  <jeremie.laval@gmail.com>
11
12         * AtomicBoolean.cs:
13         * CountdownEvent.cs:
14         * SpinLock.cs: Add BOOTSTRAP_NET_4_0 define
15
16 2010-03-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
17
18         * ThreadPool.cs: add fast path to queue work items in the runtime.
19
20 2010-03-23  Sebastien Pouliot  <sebastien@ximian.com>
21
22         * Monitor.cs: Implement new NET_4_0 (and SL4) Enter overload 
23         required to run some DRT tests (e.g. 7007)
24
25 2010-03-16  Jb Evain  <jbevain@novell.com>
26
27         * ThreadPool.cs, Thread.cs, ExecutionContext.cs: use MOONLIGHT
28         symbol to disambiguate MonoTouch and Moonlight code.
29
30 2010-03-08  Jérémie Laval  <jeremie.laval@gmail.com>
31
32         * SpinLock.cs: Merge algorithm back in SpinLock struct
33
34 2010-03-08  Jérémie Laval  <jeremie.laval@gmail.com>
35
36         * SpinLock.cs: Update to use ticket spinlock algorithm
37
38 2010-02-26 Rodrigo Kumpera  <rkumpera@novell.com>
39
40         * LazyThreadSafetyMode.cs: Added.
41
42 2010-02-08  Zoltan Varga  <vargaz@gmail.com>
43
44         * WaitHandle.cs (CheckArray): Check that the handles array is not null.
45         Fixes #576039.
46
47 2010-02-02  Jérémie Laval  <jeremie.laval@gmail.com>
48
49         * CancellationToken.cs:
50         * CancellationTokenSource.cs:
51         * ManualResetEventSlim.cs:
52         * SemaphoreSlim.cs:
53         * SpinLock.cs:
54         * SpinWait.cs:
55         * ThreadLocal.cs: Port to .NET 4 beta 2 API
56
57 2009-12-09  Jb Evain  <jbevain@novell.com>
58
59         * ThreadPool.cs (QueueUserWorkItem): properly throw
60         an ANE instead of triggering a NRE when being passed a null callback.
61
62 2009-11-02  Miguel de Icaza  <miguel@novell.com>
63
64         * Jumbo patch to drop support for pre-NET_2_0 code:
65
66         Remove ONLY_1_1 code
67         Remove NET_1_0 only code
68         Remove NET_2_0 defines assuming the value is true.
69
70 2009-11-02  Sebastien Pouliot  <sebastien@ximian.com>
71
72         * Thread.cs (set_CurrentUICulture): Delay setting in_currentculture
73         to true until after the null check and the return statement.
74
75 2009-11-02  Jérémie Laval  <jeremie.laval@gmail.com>
76
77         * Parallel.cs: Added fix for Bug #536919.
78
79 2009-10-25  Sebastien Pouliot  <sebastien@ximian.com>
80
81         * Thread.cs: Fix validations for Join and Sleep overloads
82
83 2009-10-22  Sebastien Pouliot  <sebastien@ximian.com>
84
85         * EventWaitHandle.cs: Add validation on the EventResetMode 
86         parameter used in the constructors
87         * Monitor.cs: Fix validations for TryEnter and Wait. Reduce 
88         duplicated code between overloads.
89
90 2009-10-21  Sebastien Pouliot  <sebastien@ximian.com>
91
92         * WaitHandle.cs: Add missing validations for 'millisecondsTimeout'
93         in Wait[One|Any|All]. Also call the overloaded (bool) methods for
94         WaitAll to reduce code duplication.
95
96 2009-10-20  Sebastien Pouliot  <sebastien@ximian.com>
97
98         * Timer.cs: Always call Init from every constructors to avoid 
99         duplicate checks. Fix validations on different dueTime and period
100         (ctor and Change methods). Seal private TimerComparer class and
101         avoid multiple (identical) casts in its Compare method. Seal 
102         private Scheduler class.
103
104 2009-10-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
105
106         * Timer.cs: make sure we don't insert 2 timers with the same key.
107
108 2009-10-20  Jb Evain  <jbevain@novell.com>
109
110         * Thread.cs: change type of the current_appcontext field to object
111         to avoid triggering static constructors unless explicitely required.
112
113 2009-10-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
114
115         * Timer.cs: looks like any negative value is treated as Infinite.
116
117 2009-10-07  Sebastien Pouliot  <sebastien@ximian.com>
118
119         * Thread.cs: Remove LocalDataStoreSlot-related methods from
120         Moonlight build
121
122 2009-09-29  Rolf Bjarne Kvinge  <RKvinge@novell.com>
123
124         * Thread.cs: StartSafe: ignore ThreadAbortExceptions.
125
126 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
127
128         * Timer.cs: account for the time spent sending jobs to the queue.
129
130 2009-09-26  Mark Probst  <mark.probst@gmail.com>
131
132         * Thread.cs: Serialize the principal so as not to make it cross
133         appdomains.  Two new internal calls for copying byte arrays
134         between domains.
135
136 2009-09-25  Mark Probst  <mark.probst@gmail.com>
137
138         * Thread.cs: The Thread class is split up into Thread and
139         InternalThread now.  We have exactly one InternalThread per
140         thread, and at most one Thread per appdomain per thread.  Most
141         data is stored in InternalThread.  All InternalThread objects live
142         in the root domain.
143
144         * Environment.cs: Corlib version bump.
145
146 2009-09-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
147
148         * Timer.cs: no need to wake up the scheduler when removing the next
149         scheduled item.
150
151 2009-09-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
152
153         * Timer.cs: rewritten. It only has one queue now and it is sorted by
154         due time. Before this changes, it was using a lot of CPU when there
155         were a lot of 'future' timers.
156
157 2009-09-23  Sebastien Pouliot  <sebastien@ximian.com>
158
159         * ExecutionContext.cs: Don't use SecurityContext and don't expose
160         AsyncFlowControl for NET_2_1
161         * ThreadAbortException.cs: Remove ExceptionState from NET_2_1
162         * Thread.cs: Don't expose ApartmentState and remove Suspend and
163         Resume methods for NET_2_1
164         * ThreadPool.cs: Remove GetAvailableThreads and Unsafe* methods
165         for NET_2_1
166
167 2009-09-22  Jb Evain  <jbevain@novell.com>
168
169         * Timer.cs: MONOTOUCH doesn't support remoting, so do not pass
170         true to exitContext when calling WaitOne on a WaitHandle.
171
172 2009-09-22  Sebastien Pouliot  <sebastien@ximian.com>
173
174         * Thread.cs: Remove [Get|Set]CompressedStack for NET_2_1
175
176 2009-09-21  Sebastien Pouliot  <sebastien@ximian.com>
177
178         * Thread.cs: Remove CurrentPrincipal property for NET_2_1
179         * ExecutionContext.cs: Remove Run method for NET_2_1
180
181 2009-09-20  Sebastien Pouliot  <sebastien@ximian.com>
182
183         * EventWaitHandle.cs: Remove AccessControl usage for NET_2_1
184         * Mutex.cs: Remove some ctors and AccessControl usage for NET_2_1
185         * NativeEventCalls.cs: Remove AccessControl usage for NET_2_1
186
187 2009-08-19  Jérémie Laval  <jeremie.laval@gmail.com>
188
189         * ParallelLoopState.cs: Take in account that
190         AtomicBoolean is a class.
191
192 2009-08-19  Jérémie Laval  <jeremie.laval@gmail.com>
193
194         * AtomicBoolean.cs: Turn it into a class
195         * CountdownEvent.cs: Work on cached variable. Make sure
196         count doesn't go under 0.
197
198 2009-08-11  Jérémie Laval  <jeremie.laval@gmail.com>
199
200         * Watch.cs:
201         * SpinWait.cs:
202         * CountdownEvent.cs:
203         * CancellationToken.cs:
204         * ICancelableOperation.cs:
205         * CancellationTokenSource.cs:
206         * CancellationTokenRegistration.cs: Add BOOTSTRAP_NET_4_0.
207
208 2009-08-11  Jérémie Laval  <jeremie.laval@gmail.com>
209
210         * Parallel.cs: Disable While method.
211         * CountdownEvent.cs: Fix method signature.
212         * Barrier.cs: Moved type.
213         * AggregateException.cs: Moved type.
214
215 2009-08-04 Jérémie Laval  <jeremie.laval@gmail.com>
216
217         * SpinLock: Remove unused private methods.
218
219 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
220
221         * Thread.cs: Always call Thread_free_internal from the finalizer, since
222         it frees other things besides the handle. Fixes #527576.
223
224 2009-07-31  Jérémie Laval  <jeremie.laval@gmail.com>
225
226         * Snzi.cs:
227         * Parallel.cs:
228         * SpinLock.cs:
229         * SpinWait.cs:
230         * ThreadLocal.cs:
231         * SemaphoreSlim.cs:
232         * CountdownEvent.cs:
233         * ManualResetEventSlim.cs
234         * CancellationTokenSource.cs: Various 4.0 b1 API mismatch fixes.
235
236 2009-07-30 Jérémie Laval  <jeremie.laval@gmail.com>
237
238         * AggregateException.cs:
239         * AtomicBoolean.cs:
240         * Barrier.cs:
241         * CSnzi.cs:
242         * CancellationToken.cs:
243         * CancellationTokenRegistration.cs:
244         * CancellationTokenSource.cs:
245         * CountdownEvent.cs:
246         * ICancelableOperation.cs:
247         * LazyInitializer.cs:
248         * ManualResetEventSlim.cs:
249         * Parallel.cs:
250         * ParallelLoopResult.cs:
251         * ParallelLoopState.cs:
252         * ParallelOptions.cs:
253         * SemaphoreSlim.cs:
254         * Snzi.cs:
255         * SpinLock.cs:
256         * SpinWait.cs:
257         * ThreadLocal.cs:
258         * Watch.cs: Add ParallelFx files for System.Threading namespace
259
260 2009-07-21  Jb Evain  <jbevain@novell.com>
261
262         * ThreadPool.cs: avoid an unecessary method call when not running
263         in moonlight.
264
265 2009-07-20  Jb Evain  <jbevain@novell.com>
266
267         * Thread.cs: use the moonlight specific thread start
268         hack for the net_2_1 profile exclusively.
269
270 2009-06-25  Miguel de Icaza  <miguel@novell.com>
271
272         * Timer.cs: Throw ArgumentNullException if the callback is null. 
273
274 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
275
276         * Thread.cs : Adding interrupt_on_stop field.
277
278         Contributed under MIT/X11 license.
279
280 2009-06-10  Rolf Bjarne Kvinge  <RKvinge@novell.com>
281
282         * Thread.cs: MoonlightUnhandledException: ensure there's no way to
283         reach native code with a managed exception.
284
285 2009-06-10  Sebastien Pouliot  <sebastien@ximian.com>
286
287         * Thread.cs: Refactor calling Moonlight's OnUnhandledException to 
288         make sur the delegate it not called from a [SecuritySafeCritical]
289         caller.
290         * ThreadPool.cs: Reuse the above code for QueueUserWorkItem. 
291         Original patch from Alan McGovern
292
293 2009-06-10  Marek Safar  <marek.safar@gmail.com>
294
295         * LockRecursionException.cs: New file.
296
297 2009-04-21  Mark Probst  <mark.probst@gmail.com>
298
299         * Thread.cs: Make the execution context field thread-static to
300         avoid it being shared between app domains.
301
302 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
303
304         * Thread.cs: For 2.1 ensure exceptions in threads are handled using the
305         UnhandledException event mechanism in System.Windows.Application instead
306         of crashing the application.
307
308 2009-04-18  Mark Probst  <mark.probst@gmail.com>
309
310         * Thread.cs: Don't keep the current number formatter here because
311         it's shared between app domains.
312
313 2009-04-18  Mark Probst  <mark.probst@gmail.com>
314
315         * Thread.cs: Make the abort exception state a GC handle, to
316         properly separate AppDomains.  Add internal method for getting the
317         state object.
318
319         * ThreadAbortException.cs: Get the abort exception state via the
320         method in Thread.
321
322 2009-04-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
323
324         * WaitHandle.cs: implemented 2 missing WaitAny overloads.
325
326 2009-03-05 Rolf Bjarne Kvinge  <RKvinge@novell.com>
327
328         * WaitHandle.cs: Added missing WaitOne overload.
329
330 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
331
332         * WaitHandle.cs: implemented SignalAndWait.
333
334 2009-02-18  Jb Evain  <jbevain@novell.com>
335
336         * SynchronizationContext.cs: add NET_2_1 SetThreadStaticContext
337         method, even if already obsolete.
338
339 2009-01-30  Andreia Gaita  <avidigal@novell.com>
340
341         * SynchronizationContext.cs: Remove moonlight hacks, dispatcher should
342         be able to handle this now.
343
344 2008-12-20  Miguel de Icaza  <miguel@novell.com>
345
346         * WaitHandle.cs: Add two overloads that were introduced in 3.5.
347
348 2008-11-25  Geoff Norton  <gnorton@novell.com>
349
350         * SynchronizationContext.cs: A temporary horrible hack to SyncContext
351         to hard-wire all calls back to the main thread (moonlight-only) so that
352         we can use our unit test harness.  This will be fixed for 2.1 when we
353         implement Dispatcher properly.
354
355 2008-10-30 Gonzalo Paniagua Javier <gonzalo@novell.com>
356
357         * Interlocked.cs: make CompareExchange internal in 1.1 for use by the
358         runtime.
359
360 2008-09-19  Miguel de Icaza  <miguel@novell.com>
361
362         * WaitHandle.cs (WaitOne): Add new 3.5 SP1 overload.
363
364 Tue Sep 16 21:02:59 CEST 2008 Paolo Molaro <lupus@ximian.com>
365
366         * Thread.cs: fixed SpinWait() implementation (bug #423582).
367
368 Tue Sep 9 15:19:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
369
370         * Timer.cs: use a separate queue for timers that are far in the future
371         so they don't need to be looked at as often (bug #418272).
372         Better precision of recheduling time.
373
374 2008-07-03  Andreas Nahr  <ClassDevelopment@A-SoftTech.com>
375
376         * ThreadPool.cs:
377         * LockCookie.cs:
378         * Interlocked.cs:
379         * ExecutionContext.cs:
380         * AsyncFlowControl.cs:
381         * AbandonedMutexException.cs: Fix parameter names
382
383 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
384
385         * Timer.cs (SchedulerThread): Iterate through the keys of the hashtable instead
386         of key-value pairs.
387
388 2008-06-18  Kornél Pál  <kornelpal@gmail.com>
389
390         * Thread.cs: Implement BeginThreadAffinity and EndThreadAffinity as no-op
391         because managed and native threads are currently bound together.
392
393 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
394
395         * Thread.cs: Sync layout with unmanaged side.
396
397 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
398
399         * Monitor.cs: Implement Enter/Exit directly as icalls without managed wrapper
400         methods.
401
402 2008-04-11  Zoltan Varga  <vargaz@gmail.com>
403
404         * Thread.cs: Make in_currentculture non-static. Fixes #378892.
405
406 2008-04-07  Dick Porter  <dick@ximian.com>
407
408         * Thread.cs: Fix throwing of exceptions when manipulating
409         ApartmentState.  Fixes part of bug 324338.
410
411 2008-04-01: Eyal Alaluf <eyala@mainsoft.com>
412
413         * Thread.cs: Put a NumberFormatter instance as a member of the current
414           thread so it can reused for performint ToString conversions.
415
416 2008-03-26  Massimiliano Mantione <massi@ximian.com>
417         * Thread.cs: Renamed "unused6" because it will be used to hold
418         the "mono_thread_manage" callback.
419
420 Tue Feb 26 17:51:58 CET 2008 Paolo Molaro <lupus@ximian.com>
421
422         * Timer.cs: use a monotonic clock to schedule timers
423         (fixes part of bug#347476).
424
425 Fri Feb 22 11:23:53 CET 2008 Paolo Molaro <lupus@ximian.com>
426
427         * Thread.cs: implemented Begin/EndCriticalRegion.
428
429 2008-02-03  Sebastien Pouliot  <sebastien@ximian.com>
430
431         * WaitHandle.cs: Ifdef out some unused code (found by Gendarme).
432
433 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
434
435         * Thread.cs (set_CurrentCulture): If the culture is read-only, cache the result
436         of serializing it.
437         (set_CurrentUICulture): Ditto.
438
439 2008-01-03  Zoltan Varga  <vargaz@gmail.com>
440
441         * Thread.cs (set_CurrentCulture): Avoid the serialization overhead if
442         the new culture is equal to the old one.
443
444 2007-12-27  Zoltan Varga  <vargaz@gmail.com>
445
446         * Thread.cs: Change the type of synch_cs to an IntPtr to be in synch with the
447         unmanaged definition.
448
449 2007-11-20  Atsushi Enomoto  <atsushi@ximian.com>
450
451         * ReaderWriterLock.cs : ... and avoid extra finalizer call.
452
453 2007-11-20  Atsushi Enomoto  <atsushi@ximian.com>
454
455         * ReaderWriterLock.cs : adding missing 2.0 destructor (does nothing).
456
457 Thu Nov 8 18:36:25 CET 2007 Paolo Molaro <lupus@ximian.com>
458
459         * Timer.cs: if period is 0 with a non-infinite due time, we
460         run the callback just once (bug #340212).
461
462 2007-10-24  Dick Porter  <dick@ximian.com>
463
464         * Thread.cs: Call Thread_init on the new 2.0 constructors too.
465
466 2007-10-24  Dick Porter  <dick@ximian.com>
467
468         * Thread.cs: Assign the ManagedThreadId when it is asked for,
469         rather than in the constructor, so ThreadPool threads also work.
470         Fixes bug 335579 (and doesn't break 325367 or 325566)
471
472 2007-10-24  Atsushi Enomoto  <atsushi@ximian.com>
473
474         * SynchronizationContext.cs : removed SendOrPost().
475
476 Wed Oct 17 13:24:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
477
478         * Timer.cs: better cleanup test for the expired array.
479
480 Tue Oct 16 17:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
481
482         * Timer.cs: remove expired timers from the the jobs list.
483
484 Tue Oct 16 12:14:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
485
486         * Timer.cs: rewrote to use threadpool threads to invoke the callbacks,
487         avoid Thread.Abort and Thread.Interrupt and use a single scheduler
488         thread, partially from the patch of Rafael Ferreira in bug #315999.
489         Fixes bug #315999, #332206.
490
491 2007-10-15  Dick Porter  <dick@ximian.com>
492
493         * Thread.cs: Initialise synch_cs to null now we aren't using it as
494         a monitor lock
495
496 2007-09-25  Dick Porter  <dick@ximian.com>
497
498         * Thread.cs: Keep ManagedThreadId constant over the lifetime of a
499         Thread.  Patch from jlarimer@gmail.com fixing bugs 325367 and
500         325566.
501
502 2007-09-25  Jonathan Pobst  <monkey@jpobst.com>
503
504         * SynchronizationContext.cs: Implement SetSynchronizationContext.
505
506 2007-09-06  Dick Porter  <dick@ximian.com>
507
508         * Timer.cs: Only hold a WeakReference to the runner thread, to
509         work around an issue when finalizing at shutdown or (I think)
510         appdomain unload.  (Basically, the Thread was being finalized
511         first, but the Timer's finalizer was still trying to reference it
512         subsequently.)
513
514 2007-08-10  Gert Driesen  <drieseng@users.sourceforge.net>
515
516         * Thread.cs: Throw ThreadStateException when retrieving ApartmentState
517         or IsBackground if thread is stopped. Fixes bug #81658.
518
519 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
520
521         * Thread.cs: Add a fixme.
522
523 2007-07-21  Miguel de Icaza  <miguel@novell.com>
524
525         * WaitHandle.cs (Handle): It turns out that we should never create
526         new SafeWaitHandles, as applications will assume that a
527         SafeWaitHandle pulled from this will be the same after a Handle
528         update (from Gert's test):
529
530         
531                 AutoResetEvent are1 = new AutoResetEvent (false);
532                 AutoResetEvent are2 = new AutoResetEvent (false);
533                 SafeWaitHandle swh1 = are1.SafeWaitHandle;
534                 Console.WriteLine ("#A1:" + !swh1.IsClosed);
535                 Console.WriteLine ("#A2:" + !swh1.IsInvalid);
536                 IntPtr dummyHandle = (IntPtr) 2;
537                 are1.Handle = dummyHandle;
538                 Console.WriteLine ("#A3:" + (are1.Handle == dummyHandle));
539                 Console.WriteLine ("#A4:" + !swh1.IsClosed);
540                 Console.WriteLine ("#A5:" + !swh1.IsClosed);
541                 Console.WriteLine ("#A6:" + !swh1.IsInvalid);
542                 Console.WriteLine ("#A7:" + !are1.SafeWaitHandle.IsClosed);
543                 Console.WriteLine ("#A8:" +
544                 !are1.SafeWaitHandle.IsInvalid);
545
546         We would return in A4, A5, A6 true, even when we have set the
547         Handle ourselves. 
548
549         * 
550
551 2007-07-18  Miguel de Icaza  <miguel@novell.com>
552
553         * WaitHandle.cs (Handle): in the 2.0 profile, explicitly dispose
554         the old SafeWaitHandle, do not wait for the finalizer to run;
555
556         Take ownership of the handle;   The docs did not say that
557         assigning to this value would lead to a leak, the docs said that
558         in the 1.0 and 1.1 profiles assigning to this property might lead
559         to a leak.   My mistake. 
560
561         Fixes: 82134
562         
563 2007-07-09  Atsushi Enomoto  <atsushi@ximian.com>
564
565         * LockCookie.cs, AsyncFlowControl.cs :
566           added missing operator == and !=.
567
568 2007-05-22  Jonathan Chambers  <joncham@gmail.com>
569
570         * Thread.cs: Use & to check ThreadState rather than ==.
571         Fixes AlbumSurfer regression.
572
573 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
574
575         * Thread.cs: Implement ApartmentState related items.
576
577 2007-05-02  Dick Porter  <dick@ximian.com>
578
579         * ReaderWriterLock.cs: ReaderWriterLock derives from
580         CriticalFinalizerObject in the 2.0 profile
581
582 2007-05-01  Dick Porter  <dick@ximian.com>
583
584         * ThreadState.cs: 
585         * AsyncFlowControl.cs: 
586         * Interlocked.cs: 
587         * RegisteredWaitHandle.cs: 
588         * TimerCallback.cs: 
589         * ThreadStateException.cs: 
590         * Monitor.cs: 
591         * ThreadStart.cs: 
592         * WaitOrTimerCallback.cs: 
593         * LockCookie.cs: 
594         * EventWaitHandle.cs: 
595         * WaitHandle.cs: 
596         * ThreadAbortException.cs: 
597         * ThreadPriority.cs: 
598         * ReaderWriterLock.cs: 
599         * NativeOverlapped.cs: 
600         * Mutex.cs: 
601         * Overlapped.cs: 
602         * ThreadPool.cs: 
603         * ApartmentState.cs: 
604         * EventResetMode.cs: 
605         * SynchronizationLockException.cs: 
606         * ManualResetEvent.cs: 
607         * WaitCallback.cs: 
608         * IOCompletionCallback.cs: 
609         * AutoResetEvent.cs: 
610         * AbandonedMutexException.cs: 
611         * SendOrPostCallback.cs: 
612         * ThreadInterruptedException.cs: Update to 2.0 profile
613
614 Thu Apr 19 16:47:52 CEST 2007 Paolo Molaro <lupus@ximian.com>
615
616         * ThreadPool.cs: patch from Robert Jordan to implement
617         ThreadPool.SetMaxThreads.
618
619 2007-04-03  Alp Toker  <alp@atoker.com>
620
621         * Monitor.cs: Class is static in 2.0.
622
623 2007-03-27  Dick Porter  <dick@ximian.com>
624
625         * Mutex.cs: Throw ApplicationException if ReleaseMutex() fails.
626         Fixes bug 79358.
627
628 Tue Jan 23 17:43:50 CET 2007 Paolo Molaro <lupus@ximian.com>
629
630         * Thread.cs: mark the GC-tracked field with UIntPtr.
631
632 2006-12-31  Miguel de Icaza  <miguel@novell.com>
633
634         * ThreadPool.cs: Stub a method.
635
636 2006-12-11  Miguel de Icaza  <miguel@novell.com>
637
638         * WaitHandle.cs: In 2.0 use SafeWaitHandles and the SafeWaitHandle
639         patterns instead of using directly the IntPtr Handle.
640
641         Refactor the code to reuse as much as possible, and follow the new
642         conventions where appropriate. 
643
644 2006-11-07  Robert Jordan  <robertj@gmx.net>
645
646         * WaitHandle.cs: Don't assume Assembly.GetEntryAssembly () !=
647         null.  Fixes bug #79859.
648
649 2006-11-02  Dick Porter  <dick@ximian.com>
650
651         * Thread.cs: Use the new Interrupt and SpinWait icalls.
652
653 2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
654
655         * WaitHandle.cs : CheckArray() is also used in WaitAny(), so added
656           extra argument to skip STAThread check.
657
658 2006-06-30  Duncan Mak  <duncan@novell.com>
659
660         * WaitHandle.cs (CheckArray): Avoid using reflection unless we
661         really need to.
662
663 2006-06-29  Duncan Mak  <duncan@novell.com>
664
665         * WaitHandle.cs (CheckArray): Throw NotSupportedException if the
666         current thread is marked with the STAThreadAttribute. Fixes bug
667         #78455.
668
669 2006-05-05  Sebastien Pouliot  <sebastien@ximian.com>
670
671         * ExecutionContext.cs: Don't capture the compressed stack unless the 
672         security manager is active (this wasn't ready to be called in 
673         production code).
674
675 2004-04-29  Atsushi Enomoto  <atsushi@ximian.com>
676
677         * Timer.cs : avoid NullReferenceException when it is already disposed.
678           Patch by pawel.sakowski@mind-breeze.com. Fixed bug #78208.
679
680 2004-04-28  Atsushi Enomoto  <atsushi@ximian.com>
681
682         * SynchronizationContext.cs : use ThreadPool in Post(), as suggested
683           by cl (bug #78139).
684
685 2004-04-04  Atsushi Enomoto  <atsushi@ximian.com>
686
687         * Thread.cs : base class is CriticalFinalizerObject.
688         * ThreadStartException.cs : no public constructors.
689
690 Wed Mar 29 18:29:55 CEST 2006 Paolo Molaro <lupus@ximian.com>
691
692         * Thread.cs: update for the runtime changes to culture caching.
693
694 Wed Mar 15 16:35:49 CET 2006 Paolo Molaro <lupus@ximian.com>
695
696         * Thread.cs: updates for LocalDataStoreSlot: we use an array as
697         storage for the slots now so that LocalDataStoreSlot objects an be
698         garbage collected if the user doesn't keep a reference to them.
699
700 2006-02-09  Miguel de Icaza  <miguel@novell.com>
701
702         * Monitor.cs: Patch from Thong Nguyen, Wait (.., Timeout) method
703         should allow a -1 (Timeout.Infinite) to mean indefinite wait (the
704         code already supported this.
705
706         Removed also a LAMESPEC for missing argument checking in Wait with
707         the int argument.
708         
709         Fixed the use of exceptions.
710
711 2005-12-23  Dick Porter  <dick@ximian.com>
712
713         * EventWaitHandle.cs: 
714         * Mutex.cs: Implement OpenExisting
715
716         * NativeEventCalls.cs: Add OpenEvent icall for OpenExisting in
717         2.0.  Add a "created" boolean out parameter to CreateEvent icall.
718
719         * ManualResetEvent.cs: 
720         * AutoResetEvent.cs: Update CreateEvent icall signature (now has
721         "created" boolean out parameter.)
722
723 2005-12-17  Dick Porter  <dick@ximian.com>
724
725         * ThreadStartException.cs: 
726         * EventWaitHandle.cs: 
727         * EventResetMode.cs: 
728         * AbandonedMutexException.cs: New for 2.0 profile
729
730         * ThreadState.cs: 
731         * Interlocked.cs: 
732         * RegisteredWaitHandle.cs: 
733         * Monitor.cs: 
734         * ThreadPriority.cs: 
735         * Mutex.cs: 
736         * ManualResetEvent.cs: 
737         * AutoResetEvent.cs: Updated for 2.0 profile
738
739 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
740
741         * Interlocked.cs: Add T:class constraint to the generic 
742         CompareExchange and Exchange methods.
743
744 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
745
746         * Interlocked.cs: Add generic CompareExchange and Exchange methods.
747
748 2005-11-17  Sebastien Pouliot  <sebastien@ximian.com>
749
750         * WaitHandleCannotBeOpenedException.cs: New (2.0). Is required to 
751         compile the Semaphore tests (in System.dll).
752
753 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
754
755         * SynchronizationContext.cs: A few simple fixes.
756
757 2005-10-06  Sebastien Pouliot  <sebastien@ximian.com>
758  
759         * Thread.cs: Copy an existing IPrincipal to new threads. Fix bug 
760         #76332.
761
762 2005-10-06  Sebastien Pouliot  <sebastien@ximian.com> 
763
764         * Thread.cs: Added new attributes, [ReliabilityContract] for 
765         destructor and [Obsolete] for [Get|Set]CompressedStack, that were 
766         added in 2.0 RC.
767
768 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
769
770         * Thread.cs (MemoryBarrier): Make this an icall.
771
772 2005-09-10  Zoltan Varga  <vargaz@gmail.com>
773
774         * Thread.cs (Interrupt): Make this throw a NotImplementedException.
775
776 2005-09-09  Martin Baulig  <martin@ximian.com>
777
778         * Timer.cs (Timer.Runner.Start): Silently catch
779         ObjectDisposedException and return; works around some race
780         condition on thread abort.      
781
782 2005-08-19  Dick Porter  <dick@ximian.com>
783
784         * Thread.cs: Reserve 64 bits for the thread ID.
785
786 2005-07-19  Martin Baulig  <martin@ximian.com>
787
788         * Timer.cs (Timer.Runner.Start): Fix a race condition which was
789         causing a hang on exit int he debugger: check `!disposed' before
790         `start_event.WaitOne ()' and again after it.
791
792 2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
793
794         * Thread.cs: check that the culture is valid for formatting
795         (ie, (!neutral || invariant)).
796
797 2005-06-07  Sebastien Pouliot  <sebastien@ximian.com> 
798
799         * Thread.cs: Added _Thread interface (and members) and a few missing
800         attributes (for both 1.1 and 2.0).
801
802 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
803
804         * Thread.cs Mutex.cs Monitor.cs: Add some missing 2.0 attributes.
805
806 2005-05-29  Sebastien Pouliot  <sebastien@ximian.com> 
807
808         * Timer.cs: Added new constructor for 2.0 and ComVisible attribute.
809         * Timeout.cs: This is a static class in 2.0 and ComVisible attribute.
810
811 2005-05-26  Ben Maurer  <bmaurer@ximian.com>
812
813         * Thread.cs: Use a static object for a lock rather than
814         typeof(Thread).
815
816 2005-05-26  Sebastien Pouliot  <sebastien@ximian.com> 
817  
818         * SynchronizationContext.cs: Re-introduced SendOrPost method as it's 
819         being used in System.Web.Services.
820
821 2005-05-26  Sebastien Pouliot  <sebastien@ximian.com>
822
823         * SynchronizationContext.cs: Updated to beta2 API so it doesn't depend
824         on the switcher structure anymore (which will be removed from the 
825         build).
826
827 2005-05-24  Sebastien Pouliot  <sebastien@ximian.com>
828
829         * Thread.cs: Removed #pragma which aren't supported by CSC 7.x.
830
831 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
832
833         * AsyncFlowControl.cs: Now available, as internal, in NET_1_1. This is
834         required to get some methods from SecurityContext and ExecutionContext
835         working.
836         * CompressedStack.cs: Now includes the current CompressedStack in a new
837         Capture.
838         * ExecutionContext.cs: Includes more methods in NET_1_1 to enable 
839         ThreadPool.UnsafeQueueUserWorkItem to work properly (i.e. without
840         stack propagation).
841         * Thread.cs: Made ExecutionContext field accessible from the runtime.
842         Added stack propagation when Thread.Start is called.
843         * ThreadPool.cs: QueueUserWorkItem now does stack propagation (done in
844         the runtime), so I "fixed" UnsafeQueueUserWorkItem not to do so.
845
846 2005-05-19  Miguel de Icaza  <miguel@novell.com>
847
848         * Thread.cs: REmove warnings.
849
850 2005-05-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
851
852         * Thread.cs: first check for null, then set in_currentculture.
853
854 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
855
856         * Thread.cs: Moved all checks done inside sync_lock to unmanaged code.
857         Merged Thread_internal and Start_internal into a single icall, which
858         does all work.
859
860 2005-05-11  Sebastien Pouliot  <sebastien@ximian.com> 
861
862         * CompressedStack.cs: Allow merging of an existing CompressedStack
863         with the actual stack of the current Thread.
864         * Thread.cs: GetCompressedStack and SetCompressedStack are public 
865         before 2.0 but couldn't be seen with mono-api-info because of it's 
866         LinkDemand for the ECMA public key. Removed unused CompressedStack
867         private field (now part of the ExecutionContext).
868
869 2005-05-09  Sebastien Pouliot  <sebastien@ximian.com> 
870
871         * CompressedStack.cs: GetCompressedStack is public before 2.0 but 
872         couldn't be seen with mono-api-info because of it's LinkDemand for
873         the ECMA public key. Stack capture occurs here if none exists on the
874         current thread.
875
876 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
877
878         * ReaderWriterLock.cs: fix random ApplicationException errors. Tested
879         with the System.Web.Cache stress program. Patch by Eyal Alayuf
880         (Mainsoft). Fixes 74598.
881
882 2005-04-28  Sebastien Pouliot  <sebastien@ximian.com>
883
884         * Thread.cs: Added property to get the ExecutionContext in 2.0. Fixed
885         GetCompressedStack and made SetCompressedStack available (as internal)
886         before NET_2_0.
887
888 2005-04-28  Sebastien Pouliot  <sebastien@ximian.com> 
889  
890         * AsyncFlowControl.cs: Updated wrt beta2.
891         * ExecutionContext.cs: Updated wrt beta2. Class is now internal in 
892         NET_1_1 to allow the compressed stack propagation to other threads.
893         * CompressedStack.cs: Updated wrt beta2. Class is internal in NET_1_1 
894         to allow the compressed stack propagation to other threads.
895         * ContextCallback.cs: Updated wrt beta2.
896         * HostExecutionContext.cs: Updated wrt beta2.
897         * HostExecutionContextManager.cs: Updated wrt beta2.
898         * Thread.cs: Added internal property to get the ExecutionContext.
899
900 2005-04-19  Zoltan Varga  <vargaz@freemail.hu>
901
902         * Thread.cs: Add some unused fields.
903
904 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
905
906         * ThreadPool.cs: BindHandle does nothing now.
907
908 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
909
910         * Thread.cs: clear the Unstarted bit before calling Start_internal.
911         Fixes bug #72738.
912
913 2005-04-04  Ben Maurer  <bmaurer@ximian.com>
914
915         * Thread.cs: Do argument checking for Current[UI]Culture to make
916         the exception more clear for a null value being set.
917
918 2005-03-24  Sebastien Pouliot  <sebastien@ximian.com>
919
920         * CompressedStack.cs: Added LinkDemand for UnmanagedCode and ECMA 
921         public key on GetCompressedStack method.
922         * Mutex: Added LinkDemand for UnmanagedCode to create named (system 
923         wide) mutexes.
924         * Thread.cs: Added LinkDemand for ECMA public key on [Get|Set]
925         CompressedStack methods.
926         * WaitHandle.cs: Added LinkDemand and InheritanceDemand for 
927         UnmanagedCode on set Handle property.
928
929 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
930
931         * Thread.cs: Make slothash a ThreadStatic field. Fixes #65414.
932
933 2005-02-21  Zoltan Varga  <vargaz@freemail.hu>
934
935         * Monitor.cs Interlocked.cs: Add net 2.0 ReliabilityContractAttributes.
936
937 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
938
939         * Interlocked.cs: Applied patch from Luca Barbieri (luca.barbieri@gmail.com). Add NET 2.0 methods.
940
941 Tue Feb 15 18:19:11 CET 2005 Paolo Molaro <lupus@ximian.com>
942
943         * Thread.cs: make the slothash a field in MonoThread.
944
945 2005-01-27  Sebastien Pouliot  <sebastien@ximian.com>
946
947         * Overlapped.cs: Added check for ControlPolicy and ControlEvidence for
948         Unsafe pack. Added MonoTODO for missing security stack propagation.
949         * Thread.cs: Add security checks for ControlThread.
950         * ThreadPool.cs: Added declarative security checks.
951
952 Thu Jan 13 18:15:32 CET 2005 Paolo Molaro <lupus@ximian.com>
953
954         * Thread.cs: implement stacksize and parameterized
955         start functionality (requires matching runtime).
956
957 2005-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
958
959         * ThreadAbortException.cs: added private serialization .ctor.
960
961 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
962
963         * CompressedStack.cs: Implemented most todo so it's usable for CAS.
964         * CompressedStackSwitcher.cs: Implemented most todo.
965         * Thread.cs: Implement support for getting/setting CompressedStack.
966
967 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
968
969         * Thread.cs: Change type of culture_info and ui_culture_info to 
970         IntPtr. Implement correct culture handling for the UI culture as
971         well.
972
973 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
974
975         * Thread.cs: Optimize CurrentCulture to avoid initializing the
976         serialization infrastructure in the common case when the culture is
977         not set explicitly.
978
979 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
980
981         * Thread.cs: Add new fields 'serialized_culture_info{_len}'.
982         
983         * Thread.cs (CurrentCulture): Fix leaking of culture info objects 
984         across appdomains. Partially fixes #50049.
985
986 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
987
988         * AutoResetEvent.cs (Set, Reset): If we are disposed, throw a
989         ObjectDisposedEvent, helped track the WebConnection destructor
990         issue. 
991
992 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
993
994         * Timer.cs: don't invoke the callback twice when the timer changes.
995         Fixes bug #66116.
996
997 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
998
999         * Interlocked.cs: Class is static in NET_2_0.
1000
1001 2004-09-04  Sebastien Pouliot  <sebastien@ximian.com>
1002
1003         * Thread.cs: Changed an imperative security demand to declarative
1004         (unsupported) so it doesn't (for now) call the security runtime.
1005
1006 2004-08-20  Sebastien Pouliot  <sebastien@ximian.com>
1007
1008         * Thread.cs: Added Fx 2.0 properties/methods/attributes.
1009
1010 2004-08-12  Sebastien Pouliot  <sebastien@ximian.com>
1011
1012         * CompressedStackSwitcher.cs: Added missing [ComVisible] and 
1013         [ReliabilityContract] attributes.
1014         * ExecutionContext.cs: Added missing [ComVisible] and 
1015         [Serializable] attributes.
1016         * HostExecutionContext.cs: Added missing [ComVisible] attribute.
1017         * HostExecutionContextManager.cs: Added missing [ComVisible] and 
1018         [ReliabilityContract] attributes.
1019         * HostExecutionContextSwitcher.cs: Added missing Equals and 
1020         GetHashCode methods and [ComVisible] and [ReliabilityContract] attrs.
1021         * ParameterizedThreadStart.cs: New delegate in NET_2_0.
1022         * SendOrPostCallback.cs: Added missing [ComVisible] attribute.
1023         * SynchronizationContext.cs: Added new (2.0 beta1) methods Copy and
1024         WaitHelper. Added missing [ComVisible] and [ReliabilityContract] attrs.
1025         * SynchronizationContextSwitcher.cs: Added missing [ComVisible] and 
1026         [ReliabilityContract] attributes.
1027
1028 2004-08-08  Sebastien Pouliot  <sebastien@ximian.com>
1029
1030         * HostExecutionContext.cs: Fx 2.0 stub required for AppDomain.
1031         * HostExecutionContextManager.cs: Fx 2.0 stub required for AppDomain.
1032         * HostExecutionContextSwitcher.cs: Fx 2.0 stub required for AppDomain.
1033
1034 2004-08-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1035
1036         * Timer.cs: don't invoke the callback if the period changes before the
1037         due time. Fixes bug #62421.
1038
1039 2004-07-27  Lluis Sanchez Gual  <lluis@novell.com>
1040
1041         * ExecutionContext.cs, ExecutionContextSwitcher.cs, 
1042           SynchronizationContext.cs, SynchronizationContextSwitcher.cs: Added
1043           2.0 stubs.
1044
1045 2004-07-15  Dick Porter  <dick@ximian.com>
1046
1047         * Thread.cs: Hold a lock in GetNamedDataSlot.  Fixes bug 61582,
1048         based on patch by Sbastien Robitaille
1049         (sebastien.robitaille@croesus.com).  Also fix instances of
1050         lock(typeof(Thread)) to lock a private object instead.
1051
1052 2004-07-14  Sebastien Pouliot  <sebastien@ximian.com>
1053
1054         * AsyncFlowControl.cs: New structure in Fx 2.0 required in 
1055         System.Security namespace.
1056         * CompressedStackSwitcher.cs: New structure in Fx 2.0 required in 
1057         System.Security namespace.
1058         * ContextCallback.cs: New delegate in Fx 2.0 required in 
1059         System.Security namespace.
1060         * CompressedStack.cs: Updated API for NET_2_0 profile.
1061
1062 2004-07-10  Lluis Sanchez Gual  <lluis@ximian.com>
1063
1064         * SendOrPostCallback.cs: New delegate.
1065
1066 2004-06-24  Dick Porter  <dick@ximian.com>
1067
1068         * Mutex.cs: Implement the createdNew parameter
1069
1070 2004-06-15  Gert Driesen <drieseng@users.sourceforge.net>
1071
1072         * Thread.cs: changed return type of VolatileRead to UIntPtr
1073         * ThreadPool.cs: set return type of SetMinThreads to bool
1074
1075 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
1076
1077         * Thread.cs: Added new fields to keep sync with MonoThread.
1078           Removed state changes in Sleep and Join. The state change is now done
1079           in the icall. For accessing to internal fields lock with synch_lock
1080           instead of this, which can be a source of deadlocks.
1081
1082 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
1083
1084         * Timer.cs: Don't abort the thread if Dispose() is called from the runner
1085           thread.
1086
1087 2004-06-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1088
1089         * Thread.cs:
1090         (CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set
1091         the thread IPrincipal if we get it from the AppDomain.
1092
1093 2004-06-09  Gert Driesen <drieseng@users.sourceforge.net>
1094
1095         * CompressedStack.cs: Added finalizer to match public API of
1096         MS.NET
1097
1098 2004-05-19  Lluis Sanchez Gual <lluis@ximian.com>
1099
1100         * Thread.cs: Some fixes in Abort. Implemented Suspend and Resume.
1101           Added internal interruption_requested field.
1102
1103 2004-05-13  Sebastien Pouliot  <sebastien@ximian.com>
1104
1105         * CompressedStack.cs: Added an internal constructor so a default one
1106         doesn't appear with corcompare.
1107         * Thread.cs: Added missing MemoryBarrier (only for 1.1) and SpinWait to please
1108         corcompare. Both throw a NotImplementedException.
1109         * ThreadPool.cs: Added missing UnsafeRegisterWaitForSingleObject methods (4
1110         overloads) to please corcompare. All throw a NotImplementedException.
1111
1112 2004-05-12  Zoltan Varga  <vargaz@freemail.hu>
1113
1114         * CompressedStack.cs: New file.
1115
1116 2004-04-15  Lluis Sanchez Gual <lluis@ximian.com>
1117
1118         * ThreadPool.cs: Added GetMinThreads and SetMinThreads.
1119         * Timer.cs: In Change, return false if the timer has been disposed.
1120         In Dispose, notify the WaitHandle.
1121
1122 2004-04-11  Lluis Sanchez Gual <lluis@ximian.com>
1123
1124         * ReaderWriterLock.cs: More fixes: never wait where acquiring a reader lock
1125           if the thread already has the lock. Added readyWaitingReaders variable to
1126           keep track of threads ready to get the reader lock.
1127
1128 2004-04-11  Lluis Sanchez Gual <lluis@ximian.com>
1129
1130         * LockQueue.cs: Moved lockCount change inside the rwlock lock. Removed
1131           lock(this) when entering the rwlock to avoid a deadlock.
1132         * ReaderWriterLock.cs: In AcquireWriterLock, queue the thread if the queue
1133           is not empty (even if state==0).
1134
1135 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
1136
1137         * Timer.cs: Call the callback immediately if dueTime is 0. Fixes
1138         #56728.
1139
1140 2004-04-08  Jackson Harper  <jackson@ximian.com>
1141
1142         * ReaderWriterLock.cs: Fix tyop
1143         
1144 2004-04-08  Lluis Sanchez Gual <lluis@ximian.com>
1145
1146         * ReaderWriterLock.cs: Changed some methods to private.
1147         * WaitHandle.cs: In Wait methods, release the synchronization context when 
1148           exitContext is true.
1149
1150 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1151
1152         * Timer.cs: call Abort on the Runner instance too.
1153
1154 2004-04-07  Jackson Harper  <jackson@ximian.com>
1155
1156         * Thread.cs: Use new culture info method for constructing the
1157         current culture.
1158         
1159 2004-04-07  Lluis Sanchez Gual <lluis@ximian.com>
1160
1161         * ReaderWriterLock.cs: When a thread holds a writer lock, a call to
1162           AcquireReaderLock works like a call to AcquireWriterLock.
1163
1164 2004-04-06  Lluis Sanchez Gual <lluis@ximian.com>
1165
1166         * Monitor.cs: In Wait(), release the synchronization context when 
1167           exitContext is true.
1168
1169 2004-04-06  Lluis Sanchez Gual <lluis@ximian.com>
1170
1171         * LockCookie.cs: Keep in this class the count of reader or writer locks
1172           for a thread, not only whether it has locks or not.
1173         * LockQueue.cs: Added property for checking if a thread is waiting in
1174           the queue. Wait now returns a boolean that set to false on timeout 
1175           expiration.
1176         * ReaderWriterLock.cs: Started fixing bugs but I had to rewrite a lot of it.
1177           The main change is that now it keeps a reader lock count for each
1178           thread. This is needed since methods like ReleaseLock or 
1179           UpgradeToWriterLock need to return a per-thread status in LockCookie.
1180           Also added support for recursive writer-lock requests.
1181
1182 2004-03-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1183
1184         * ThreadAbortException.cs: use same HResult as MS.
1185         * Timer.cs: abort the running thread when disposing the Timer. This
1186         fixes NullRefs when finishing xsp.
1187
1188 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1189
1190         * NativeOverlapped.cs: added 2 new internal fields.
1191         * Overlapped.cs: implemented, but it's not used.
1192
1193         * ThreadPool.cs: implemented BindHandle.
1194
1195 2004-03-08  Zoltan Varga  <vargaz@freemail.hu>
1196
1197         * Timer.cs (Dispose): Applied patch from Jaroslaw Kowalski 
1198         (jaak@zd.com.pl). Fix finalization problems during appdomain unload.
1199
1200 2004-02-23  Jackson Harper <jackson@ximian.com>
1201
1202         * LockCookie.cs: Add some fields for restoring locks.
1203         * ReaderWriterLock.cs: Implement
1204         * LockQueue.cs: New File - used for queueing thread locks in
1205         ReaderWriterLock.
1206         
1207 2004-02-19  Jackson Harper <jackson@ximian.com>
1208
1209         * Monitor.cs: Fix spelleng.
1210         
1211 2004-02-09  Zoltan Varga  <vargaz@freemail.hu>
1212
1213         * Thread.cs: Add fields added to unmanaged MonoThread here as well.
1214         Fixes random errors caused by memory corruption.
1215
1216 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
1217
1218         * Thread.cs: Store the thread name in unmanaged memory, since the
1219         thread object is shared between appdomains.
1220
1221 2004-02-05  Sebastien Pouliot  <sebastien@ximian.com>
1222
1223         * Thread.cs: Implemented CurrentPrincipal.
1224
1225 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1226
1227         * Thread.cs: delayed thread creation until Start is called. If we
1228         don't do that and Start() is not called, the thread is leaked. First
1229         step towards fixing bug #53078. 
1230
1231 2003-12-02  Dick Porter  <dick@ximian.com>
1232
1233         * Thread.cs: Throw InvalidOperationException if Thread.Name is
1234         already set.
1235
1236 2003-12-01  Dick Porter  <dick@ximian.com>
1237
1238         * Thread.cs: Implement CurrentCulture and CurrentUICulture
1239
1240 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
1241
1242         * Thread.cs: Add new VolatileRead/VolatileWrite methods from 1.1
1243
1244 2003-10-23  Lluis Sanchez Gual  <lluis@ximian.com>
1245
1246         * Thread.cs: Added ResetDataStoreStatus and RestoreDataStoreStatus
1247           methods. They are used in CrossAppDomainChannel to save and restore
1248           thread's local data when switching between domains.
1249
1250 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1251
1252         * ManualResetEvent.cs: added check for disposed.
1253         * Thread.cs: no need to init this field.
1254
1255 2003-10-01  Zoltan Varga  <vargaz@freemail.hu>
1256
1257         * Thread.cs: Add locking to AllocateNamedDataSlot and 
1258         FreeNamedDataSlot.
1259
1260 Wed Aug 20 12:01:36 CEST 2003 Paolo Molaro <lupus@ximian.com>
1261
1262         * Thread.cs: put all the fields at the start and add
1263         more fields needed by the runtime.
1264
1265 2003-08-14  Lluis Sanchez Gual  <lluis@ximian.com>
1266
1267         * Thread.cs: SetData() method: use Hashtable.Contains to check
1268           if a dataslot has been allocated (value could be null).
1269
1270 2003-07-23  Duncan Mak  <duncan@ximian.com>
1271
1272         * WaitHandle.cs (CheckDisposed): This method is not in the public
1273         API, mark it as 'internal'.
1274
1275 2003-07-01  Dick Porter  <dick@ximian.com>
1276
1277         * Thread.cs: Throw an exception if thread creation failed.
1278         (Better than just blowing up later.)
1279
1280 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
1281
1282         * ThreadPool.cs: use async delegate invoke.
1283
1284 2003-06-25  Dick Porter  <dick@ximian.com>
1285
1286         * WaitHandle.cs: Default handle value should be InvalidHandle, not
1287         Zero.
1288
1289 2003-06-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1290
1291         * ThreadPool.cs: correctly create a TimeSpan with provided the number of
1292         milliseconds.
1293
1294         * WaitHandle.cs: fixes for WaitAny/All and TimeSpan.
1295
1296 2003-06-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1297
1298         * WaitHandle.cs: checks and exceptions.
1299
1300 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1301
1302         * NativeEventCalls.cs: added CloseEvent_intenal.
1303         * WaitHandle.cs: call CloseEvent_internal when disposing.
1304
1305 2003-05-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1306
1307         * RegisteredWaitHandle.cs: check that the callback is not null before
1308         invoking.
1309
1310         * ThreadPool.cs: fixed timeout -> TimeSpan conversions (closes bug
1311         #43963). Queue the item before setting the handle. If there's a timeout,
1312         avoid trying to Dequeue, getting the exception et al, just continue the
1313         loop.
1314
1315 Mon May 19 09:07:45 CEST 2003 Paolo Molaro <lupus@ximian.com>
1316
1317         * Monitor.cs: removed test_owner, the check is already done in the
1318         icall.
1319
1320 Tue May 13 15:34:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
1321
1322         * Thread.cs: added missing field used by the runtime and
1323         a new field to support thread-static data.
1324
1325 2003-04-17  Pedro Mart?ez Juli? <yoros@wanadoo.es>
1326
1327         * Timer.cs: Change the position of two lines because they were
1328         before the "if" that ensures the integrity. After this, the first of
1329         that two lines was producing a NullReferenceException.
1330
1331 2003-04-09  Dick Porter  <dick@ximian.com>
1332
1333         * Thread.cs: Make sure a reference to the ThreadStart delegate is
1334         held.  There's no telling how long it will be before
1335         Thread.Start() is called, and GC might destroy the delegate.
1336         Thread() and Start() need to be rewritten so that the runtime
1337         creates the new thread when Start() is called, which will simplify
1338         the code a great deal.
1339
1340 2003-03-20  Miguel de Icaza  <miguel@ximian.com>
1341
1342         * Thread.cs (CurrentCuluture): use the invaraint culture instead
1343         of "" for the current_culture setting.
1344
1345 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
1346
1347         * Thread.cs: Fix visibility of ResetAbort().
1348
1349 2003-03-18  Dick Porter  <dick@ximian.com>
1350
1351         * Thread.cs: Keep the thread state updated in all the places that
1352         require it.  (Suspend, Resume and Interrupt not handled yet)
1353
1354 2003-03-03  Lluis Sanchez Gual <lluis@ideary.com>
1355
1356         * Thread.cs: Changed implementation of CurrentContext, adapted to the changes
1357           in the runtime.
1358
1359 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1360
1361         * Thread.cs: implemented CurrentContext.
1362
1363 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1364
1365         * Thread.cs: made the thread_id for the current thread accesible through
1366         an internal property.  
1367
1368 2003-02-17  Dick Porter  <dick@ximian.com>
1369
1370         * Thread.cs: Added the Start semaphore field to the class.  Update
1371         the thread state after Start() has returned, not before.
1372
1373 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
1374
1375         * Thread.cs (Sleep): Timeout.Infinite is a value argument.
1376
1377 2003-02-11  Dick Porter  <dick@ximian.com>
1378
1379         * Monitor.cs: Infinite wait is Infinite, not 0 ms
1380
1381 2003-02-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1382
1383         * Thread.cs: fixed bug #37759.
1384
1385 2003-02-07  Patrik Torstensson
1386
1387         * Timer.cs: Set the Background thread flag for the timer thread
1388
1389 2003-02-05  Patrik Torstensson
1390
1391         * ThreadPool.cs: Reformated and fixed issue that made all thread exit the pool. 
1392
1393 2003-02-04  Lluis Sanchez Gual <lluis@ideary.com>
1394
1395         * ThreadPool.cs: Implemented RegisterWaitForSingleObject methods.
1396
1397 Tue Jan 28 17:55:59 CET 2003 Paolo Molaro <lupus@ximian.com>
1398
1399         * Thread.cs: delay-init datastorehash.
1400
1401 2003-01-10  Patrik Torstensson  <totte@race-x-change.com>
1402
1403         * ThreadPool.cs: Temporary removed the usage of monitor thread, implemented a 
1404                     model more equal to the MS one.
1405
1406 2002-12-10  Dick Porter  <dick@ximian.com>
1407
1408         * Monitor.cs:
1409         * Thread.cs:
1410         * ThreadPool.cs:
1411         * Timer.cs:
1412         * WaitHandle.cs: Use TotalMilliseconds to convert a TimeSpan to
1413         ms, not Milliseconds.
1414
1415 2002-12-07  Martin Baulig  <martin@ximian.com>
1416
1417         * Timer.cs: Make it actually work; now it no longer sets your
1418         application on fire if you use a zero periode and Timer.Change()
1419         actually works.
1420
1421 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1422
1423         * Timer.cs: implemented more stuff. It works now.
1424
1425 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
1426
1427         * Thread.cs: Implement GetDomain() and GetDomainID().
1428
1429 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1430
1431         * ThreadPool.cs: now the monitor thread is not sleeping and checking if
1432         more worker threads needed. It waits on _DataInQueue. If (and only if)
1433         there's data in the queue it checks if more worker threads needed and
1434         then sleeps 0.5s before waiting for queued data again.
1435
1436 2002-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1437
1438         * ThreadPool.cs: set IsThreadPoolThread before starting the worker.
1439
1440 2002-09-11  Dick Porter  <dick@ximian.com>
1441
1442         * Mutex.cs: 
1443         * ManualResetEvent.cs: 
1444         * AutoResetEvent.cs: Use the WaitHandle.Handle property instead of
1445         the private field
1446
1447         * WaitHandle.cs: Hide the os_handle field and the WaitOne_internal
1448         method
1449
1450 2002-09-03  Dick Porter  <dick@ximian.com>
1451
1452         * Thread.cs: Added thread ID field
1453
1454 2002-08-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1455
1456         * WaitHandle.cs: IDisposable fixes.
1457
1458 2002-08-14  Dick Porter  <dick@ximian.com>
1459
1460         * Thread.cs: Make CurrentUICulture act the same as CurrentCulture
1461         for now.
1462
1463 2002-08-12  Dietmar Maurer  <dietmar@ximian.com>
1464
1465         * ThreadAbortException.cs: impl. ExceptionState property.
1466
1467         * Thread.cs: moved all instance variables to the start of the
1468         class. added support for Thread::Abort()
1469
1470 2002-04-30  Dick Porter  <dick@ximian.com>
1471
1472         * Thread.cs: If LocalDataStoreSlot already has data set, remove it
1473         before adding a new one.
1474
1475         Use the Thread object destructor to tell the runtime to close the
1476         thread handle.
1477
1478 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
1479
1480         * Interlocked.cs: made all methods icalls.
1481
1482 2002-04-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1483
1484         * IOCompletionCallback.cs: added attributes to the delegate
1485         (CLSCompliant(false) and Serializable).
1486
1487 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
1488         * Thread.cs: Fixed IsThreadPoolThread to use a internal property instead of extending 
1489                                  the threadstate enum.
1490         * ThreadPool.cs: Now using the internal Isthreadpoolthread property
1491         * ThreadState.cs: removed non-standard enum (ThreadPoolThread)
1492
1493 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
1494
1495         * ThreadState.cs: Added enum for threadpool thread
1496         * Thread.cs: changed the set/clr_state to be internal (used from threadpool)
1497         * Thread.cs: Added IsThreadPoolThread
1498         * ThreadPool.cs: Implementation of QueueUserWorkItem
1499
1500 Wed Feb 13 21:51:30 CET 2002 Paolo Molaro <lupus@ximian.com>
1501
1502         * Thread.cs: implement CurrentCulture property needed by
1503         Convert.ChangeType() (used when compiling enums).
1504
1505 2002-01-23  Dick Porter  <dick@ximian.com>
1506
1507         * ManualResetEvent.cs: 
1508         * AutoResetEvent.cs: Fixed DOS line endings
1509
1510 2002-01-22  Veronica De Santis <veron78@interfree.it>   
1511         
1512         * NativeEventCalls : Class that contains internal calls shared by Auto 
1513                              and Manual Reset Events
1514         * AutoResetEvents.cs : Added class AutoResetEvents and its implementation
1515         * ManualResetEvents.cs : Added class ManualResetEvents and its implementation
1516
1517 2002-01-16  Veronica De Santis <veron78@interfree.it>   
1518         
1519         * WaitHandle.cs : Renamed handle to os_handle and make it protected
1520                           instead of private.
1521         * Mutex.cs : Write the System.Threading.Mutex methods ( constructors 
1522                      and the ReleaseMutex)
1523
1524 2002-01-15  Dick Porter  <dick@ximian.com>
1525
1526         * WaitHandle.cs:
1527         * Thread.cs: Make the runtime's idea of infinite timeouts coincide
1528         with the class library's
1529
1530 2002-01-10  Dick Porter  <dick@ximian.com>
1531
1532         * WaitHandle.cs: Added checks for too many handles and null
1533         handles in WaitAll() and WaitAny
1534         
1535
1536 2002-01-05  Ravi Pratap  <ravi@ximian.com>
1537
1538         * AutoResetEvent.cs, ManualResetEvent.cs, Monitor.cs : MonoTODO
1539         decoration.
1540
1541         * Mutex.cs, Overlapped.cs, ReaderWriterLock.cs, RegisteredWaitHandle.cs,
1542         Thread.cs, ThreadAbortException.cs, ThreadPool.cs, Timer.cs, WaitHandler.cs : Ditto.
1543
1544 2001-12-11  Dick Porter  <dick@ximian.com>
1545
1546         * WaitHandle.cs: Implemented WaitAll(), WaitAny() and WaitOne() as
1547         internal calls.
1548
1549 2001-11-26  Dick Porter  <dick@ximian.com>
1550
1551         * Thread.cs: DataSlot uses a single system TLS slot, and a
1552         hashtable per thread.  Some minor changes to reflect the new
1553         internal calls using the new IO library, and the newly-supported
1554         bool returns from internal calls.
1555
1556         * Monitor.cs: Use bool returns from internal calls now they are
1557         supported by the runtime.  Coalesce enter with the try_enter
1558         internal call.
1559
1560 Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <lupus@ximian.com>
1561
1562         * Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.
1563
1564 2001-10-03  Dick Porter  <dick@ximian.com>
1565
1566         * Monitor.cs: Implemented all methods except the two Wait()
1567         methods that take boolean parameters
1568
1569 2001-09-28  Dick Porter  <dick@ximian.com>
1570
1571         * Thread.cs: Implemented AllocateDataSlot(),
1572         AllocateNamedDataSlot(), FreeNamedDataSlot(), GetData(),
1573         GetNamedDataSlot(), SetData(), IsBackground.  Reworked Thread()
1574         and Start() to avoid a race condition. Added thread-safe state
1575         changing private operations.
1576
1577         * Monitor.cs: Comment out the GetType() calls because it isn't implemented yet
1578
1579 2001-09-25  Dick Porter  <dick@ximian.com>
1580
1581         * Thread.cs: Implement Join and timed Join, set correct state
1582         around Start, Join and Sleep calls, implement IsAlive and
1583         ThreadState properties.
1584
1585         * ThreadState.cs (Threading): Added StopRequested,
1586         SuspendRequested, Suspended values
1587
1588 2001-09-23  Dick Porter  <dick@ximian.com>
1589
1590         * Thread.cs: Implemented CurrentThread and Sleep (both versions)
1591         with internal calls, and Name.
1592
1593 2001-09-21  Dick Porter  <dick@ximian.com>
1594
1595         * Thread.cs: Implement Thread(ThreadStart) constructor and Start()
1596         with an internal call
1597
1598         * WaitHandle.cs: Close calls Dispose(false)
1599
1600 2001-09-13  Dick Porter  <dick@ximian.com>
1601
1602         * ApartmentState.cs (Threading): Set the correct enum values
1603
1604 2001-09-13  Dick Porter  <dick@ximian.com>
1605
1606         * ApartmentState.cs, AutoResetEvent.cs, IOCompletionCallback.cs,
1607         Interlocked.cs, LockCookie.cs, ManualResetEvent.cs, Monitor.cs,
1608         Mutex.cs, NativeOverlapped.cs, Overlapped.cs, ReaderWriterLock.cs,
1609         RegisteredWaitHandle.cs, SynchronizationLockException.cs,
1610         Thread.cs, ThreadAbortException.cs, ThreadInterruptedException.cs,
1611         ThreadPool.cs, ThreadStart.cs, ThreadStateException.cs,
1612         Timeout.cs, Timer.cs, TimerCallback.cs, WaitCallback.cs,
1613         WaitHandle.cs, WaitOrTimerCallback.cs: System.Threading class
1614         stubs.
1615         
1616 2001-07-18  Michael Lambert <michaellambert@email.com>
1617
1618         * ThreadPriority.cs, ThreadState.cs: Add.