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