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