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