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