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