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