2007-07-18 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / class / corlib / System.Threading / ChangeLog
1 2007-07-18  Miguel de Icaza  <miguel@novell.com>
2
3         * WaitHandle.cs (Handle): in the 2.0 profile, explicitly dispose
4         the old SafeWaitHandle, do not wait for the finalizer to run;
5
6         Take ownership of the handle;   The docs did not say that
7         assigning to this value would lead to a leak, the docs said that
8         in the 1.0 and 1.1 profiles assigning to this property might lead
9         to a leak.   My mistake. 
10
11         Fixes: 82134
12         
13 2007-07-09  Atsushi Enomoto  <atsushi@ximian.com>
14
15         * LockCookie.cs, AsyncFlowControl.cs :
16           added missing operator == and !=.
17
18 2007-05-22  Jonathan Chambers  <joncham@gmail.com>
19
20         * Thread.cs: Use & to check ThreadState rather than ==.
21         Fixes AlbumSurfer regression.
22
23 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
24
25         * Thread.cs: Implement ApartmentState related items.
26
27 2007-05-02  Dick Porter  <dick@ximian.com>
28
29         * ReaderWriterLock.cs: ReaderWriterLock derives from
30         CriticalFinalizerObject in the 2.0 profile
31
32 2007-05-01  Dick Porter  <dick@ximian.com>
33
34         * ThreadState.cs: 
35         * AsyncFlowControl.cs: 
36         * Interlocked.cs: 
37         * RegisteredWaitHandle.cs: 
38         * TimerCallback.cs: 
39         * ThreadStateException.cs: 
40         * Monitor.cs: 
41         * ThreadStart.cs: 
42         * WaitOrTimerCallback.cs: 
43         * LockCookie.cs: 
44         * EventWaitHandle.cs: 
45         * WaitHandle.cs: 
46         * ThreadAbortException.cs: 
47         * ThreadPriority.cs: 
48         * ReaderWriterLock.cs: 
49         * NativeOverlapped.cs: 
50         * Mutex.cs: 
51         * Overlapped.cs: 
52         * ThreadPool.cs: 
53         * ApartmentState.cs: 
54         * EventResetMode.cs: 
55         * SynchronizationLockException.cs: 
56         * ManualResetEvent.cs: 
57         * WaitCallback.cs: 
58         * IOCompletionCallback.cs: 
59         * AutoResetEvent.cs: 
60         * AbandonedMutexException.cs: 
61         * SendOrPostCallback.cs: 
62         * ThreadInterruptedException.cs: Update to 2.0 profile
63
64 Thu Apr 19 16:47:52 CEST 2007 Paolo Molaro <lupus@ximian.com>
65
66         * ThreadPool.cs: patch from Robert Jordan to implement
67         ThreadPool.SetMaxThreads.
68
69 2007-04-03  Alp Toker  <alp@atoker.com>
70
71         * Monitor.cs: Class is static in 2.0.
72
73 2007-03-27  Dick Porter  <dick@ximian.com>
74
75         * Mutex.cs: Throw ApplicationException if ReleaseMutex() fails.
76         Fixes bug 79358.
77
78 Tue Jan 23 17:43:50 CET 2007 Paolo Molaro <lupus@ximian.com>
79
80         * Thread.cs: mark the GC-tracked field with UIntPtr.
81
82 2006-12-31  Miguel de Icaza  <miguel@novell.com>
83
84         * ThreadPool.cs: Stub a method.
85
86 2006-12-11  Miguel de Icaza  <miguel@novell.com>
87
88         * WaitHandle.cs: In 2.0 use SafeWaitHandles and the SafeWaitHandle
89         patterns instead of using directly the IntPtr Handle.
90
91         Refactor the code to reuse as much as possible, and follow the new
92         conventions where appropriate. 
93
94 2006-11-07  Robert Jordan  <robertj@gmx.net>
95
96         * WaitHandle.cs: Don't assume Assembly.GetEntryAssembly () !=
97         null.  Fixes bug #79859.
98
99 2006-11-02  Dick Porter  <dick@ximian.com>
100
101         * Thread.cs: Use the new Interrupt and SpinWait icalls.
102
103 2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
104
105         * WaitHandle.cs : CheckArray() is also used in WaitAny(), so added
106           extra argument to skip STAThread check.
107
108 2006-06-30  Duncan Mak  <duncan@novell.com>
109
110         * WaitHandle.cs (CheckArray): Avoid using reflection unless we
111         really need to.
112
113 2006-06-29  Duncan Mak  <duncan@novell.com>
114
115         * WaitHandle.cs (CheckArray): Throw NotSupportedException if the
116         current thread is marked with the STAThreadAttribute. Fixes bug
117         #78455.
118
119 2006-05-05  Sebastien Pouliot  <sebastien@ximian.com>
120
121         * ExecutionContext.cs: Don't capture the compressed stack unless the 
122         security manager is active (this wasn't ready to be called in 
123         production code).
124
125 2004-04-29  Atsushi Enomoto  <atsushi@ximian.com>
126
127         * Timer.cs : avoid NullReferenceException when it is already disposed.
128           Patch by pawel.sakowski@mind-breeze.com. Fixed bug #78208.
129
130 2004-04-28  Atsushi Enomoto  <atsushi@ximian.com>
131
132         * SynchronizationContext.cs : use ThreadPool in Post(), as suggested
133           by cl (bug #78139).
134
135 2004-04-04  Atsushi Enomoto  <atsushi@ximian.com>
136
137         * Thread.cs : base class is CriticalFinalizerObject.
138         * ThreadStartException.cs : no public constructors.
139
140 Wed Mar 29 18:29:55 CEST 2006 Paolo Molaro <lupus@ximian.com>
141
142         * Thread.cs: update for the runtime changes to culture caching.
143
144 Wed Mar 15 16:35:49 CET 2006 Paolo Molaro <lupus@ximian.com>
145
146         * Thread.cs: updates for LocalDataStoreSlot: we use an array as
147         storage for the slots now so that LocalDataStoreSlot objects an be
148         garbage collected if the user doesn't keep a reference to them.
149
150 2006-02-09  Miguel de Icaza  <miguel@novell.com>
151
152         * Monitor.cs: Patch from Thong Nguyen, Wait (.., Timeout) method
153         should allow a -1 (Timeout.Infinite) to mean indefinite wait (the
154         code already supported this.
155
156         Removed also a LAMESPEC for missing argument checking in Wait with
157         the int argument.
158         
159         Fixed the use of exceptions.
160
161 2005-12-23  Dick Porter  <dick@ximian.com>
162
163         * EventWaitHandle.cs: 
164         * Mutex.cs: Implement OpenExisting
165
166         * NativeEventCalls.cs: Add OpenEvent icall for OpenExisting in
167         2.0.  Add a "created" boolean out parameter to CreateEvent icall.
168
169         * ManualResetEvent.cs: 
170         * AutoResetEvent.cs: Update CreateEvent icall signature (now has
171         "created" boolean out parameter.)
172
173 2005-12-17  Dick Porter  <dick@ximian.com>
174
175         * ThreadStartException.cs: 
176         * EventWaitHandle.cs: 
177         * EventResetMode.cs: 
178         * AbandonedMutexException.cs: New for 2.0 profile
179
180         * ThreadState.cs: 
181         * Interlocked.cs: 
182         * RegisteredWaitHandle.cs: 
183         * Monitor.cs: 
184         * ThreadPriority.cs: 
185         * Mutex.cs: 
186         * ManualResetEvent.cs: 
187         * AutoResetEvent.cs: Updated for 2.0 profile
188
189 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
190
191         * Interlocked.cs: Add T:class constraint to the generic 
192         CompareExchange and Exchange methods.
193
194 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
195
196         * Interlocked.cs: Add generic CompareExchange and Exchange methods.
197
198 2005-11-17  Sebastien Pouliot  <sebastien@ximian.com>
199
200         * WaitHandleCannotBeOpenedException.cs: New (2.0). Is required to 
201         compile the Semaphore tests (in System.dll).
202
203 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
204
205         * SynchronizationContext.cs: A few simple fixes.
206
207 2005-10-06  Sebastien Pouliot  <sebastien@ximian.com>
208  
209         * Thread.cs: Copy an existing IPrincipal to new threads. Fix bug 
210         #76332.
211
212 2005-10-06  Sebastien Pouliot  <sebastien@ximian.com> 
213
214         * Thread.cs: Added new attributes, [ReliabilityContract] for 
215         destructor and [Obsolete] for [Get|Set]CompressedStack, that were 
216         added in 2.0 RC.
217
218 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
219
220         * Thread.cs (MemoryBarrier): Make this an icall.
221
222 2005-09-10  Zoltan Varga  <vargaz@gmail.com>
223
224         * Thread.cs (Interrupt): Make this throw a NotImplementedException.
225
226 2005-09-09  Martin Baulig  <martin@ximian.com>
227
228         * Timer.cs (Timer.Runner.Start): Silently catch
229         ObjectDisposedException and return; works around some race
230         condition on thread abort.      
231
232 2005-08-19  Dick Porter  <dick@ximian.com>
233
234         * Thread.cs: Reserve 64 bits for the thread ID.
235
236 2005-07-19  Martin Baulig  <martin@ximian.com>
237
238         * Timer.cs (Timer.Runner.Start): Fix a race condition which was
239         causing a hang on exit int he debugger: check `!disposed' before
240         `start_event.WaitOne ()' and again after it.
241
242 2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
243
244         * Thread.cs: check that the culture is valid for formatting
245         (ie, (!neutral || invariant)).
246
247 2005-06-07  Sebastien Pouliot  <sebastien@ximian.com> 
248
249         * Thread.cs: Added _Thread interface (and members) and a few missing
250         attributes (for both 1.1 and 2.0).
251
252 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
253
254         * Thread.cs Mutex.cs Monitor.cs: Add some missing 2.0 attributes.
255
256 2005-05-29  Sebastien Pouliot  <sebastien@ximian.com> 
257
258         * Timer.cs: Added new constructor for 2.0 and ComVisible attribute.
259         * Timeout.cs: This is a static class in 2.0 and ComVisible attribute.
260
261 2005-05-26  Ben Maurer  <bmaurer@ximian.com>
262
263         * Thread.cs: Use a static object for a lock rather than
264         typeof(Thread).
265
266 2005-05-26  Sebastien Pouliot  <sebastien@ximian.com> 
267  
268         * SynchronizationContext.cs: Re-introduced SendOrPost method as it's 
269         being used in System.Web.Services.
270
271 2005-05-26  Sebastien Pouliot  <sebastien@ximian.com>
272
273         * SynchronizationContext.cs: Updated to beta2 API so it doesn't depend
274         on the switcher structure anymore (which will be removed from the 
275         build).
276
277 2005-05-24  Sebastien Pouliot  <sebastien@ximian.com>
278
279         * Thread.cs: Removed #pragma which aren't supported by CSC 7.x.
280
281 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
282
283         * AsyncFlowControl.cs: Now available, as internal, in NET_1_1. This is
284         required to get some methods from SecurityContext and ExecutionContext
285         working.
286         * CompressedStack.cs: Now includes the current CompressedStack in a new
287         Capture.
288         * ExecutionContext.cs: Includes more methods in NET_1_1 to enable 
289         ThreadPool.UnsafeQueueUserWorkItem to work properly (i.e. without
290         stack propagation).
291         * Thread.cs: Made ExecutionContext field accessible from the runtime.
292         Added stack propagation when Thread.Start is called.
293         * ThreadPool.cs: QueueUserWorkItem now does stack propagation (done in
294         the runtime), so I "fixed" UnsafeQueueUserWorkItem not to do so.
295
296 2005-05-19  Miguel de Icaza  <miguel@novell.com>
297
298         * Thread.cs: REmove warnings.
299
300 2005-05-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
301
302         * Thread.cs: first check for null, then set in_currentculture.
303
304 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
305
306         * Thread.cs: Moved all checks done inside sync_lock to unmanaged code.
307         Merged Thread_internal and Start_internal into a single icall, which
308         does all work.
309
310 2005-05-11  Sebastien Pouliot  <sebastien@ximian.com> 
311
312         * CompressedStack.cs: Allow merging of an existing CompressedStack
313         with the actual stack of the current Thread.
314         * Thread.cs: GetCompressedStack and SetCompressedStack are public 
315         before 2.0 but couldn't be seen with mono-api-info because of it's 
316         LinkDemand for the ECMA public key. Removed unused CompressedStack
317         private field (now part of the ExecutionContext).
318
319 2005-05-09  Sebastien Pouliot  <sebastien@ximian.com> 
320
321         * CompressedStack.cs: GetCompressedStack is public before 2.0 but 
322         couldn't be seen with mono-api-info because of it's LinkDemand for
323         the ECMA public key. Stack capture occurs here if none exists on the
324         current thread.
325
326 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
327
328         * ReaderWriterLock.cs: fix random ApplicationException errors. Tested
329         with the System.Web.Cache stress program. Patch by Eyal Alayuf
330         (Mainsoft). Fixes 74598.
331
332 2005-04-28  Sebastien Pouliot  <sebastien@ximian.com>
333
334         * Thread.cs: Added property to get the ExecutionContext in 2.0. Fixed
335         GetCompressedStack and made SetCompressedStack available (as internal)
336         before NET_2_0.
337
338 2005-04-28  Sebastien Pouliot  <sebastien@ximian.com> 
339  
340         * AsyncFlowControl.cs: Updated wrt beta2.
341         * ExecutionContext.cs: Updated wrt beta2. Class is now internal in 
342         NET_1_1 to allow the compressed stack propagation to other threads.
343         * CompressedStack.cs: Updated wrt beta2. Class is internal in NET_1_1 
344         to allow the compressed stack propagation to other threads.
345         * ContextCallback.cs: Updated wrt beta2.
346         * HostExecutionContext.cs: Updated wrt beta2.
347         * HostExecutionContextManager.cs: Updated wrt beta2.
348         * Thread.cs: Added internal property to get the ExecutionContext.
349
350 2005-04-19  Zoltan Varga  <vargaz@freemail.hu>
351
352         * Thread.cs: Add some unused fields.
353
354 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
355
356         * ThreadPool.cs: BindHandle does nothing now.
357
358 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
359
360         * Thread.cs: clear the Unstarted bit before calling Start_internal.
361         Fixes bug #72738.
362
363 2005-04-04  Ben Maurer  <bmaurer@ximian.com>
364
365         * Thread.cs: Do argument checking for Current[UI]Culture to make
366         the exception more clear for a null value being set.
367
368 2005-03-24  Sebastien Pouliot  <sebastien@ximian.com>
369
370         * CompressedStack.cs: Added LinkDemand for UnmanagedCode and ECMA 
371         public key on GetCompressedStack method.
372         * Mutex: Added LinkDemand for UnmanagedCode to create named (system 
373         wide) mutexes.
374         * Thread.cs: Added LinkDemand for ECMA public key on [Get|Set]
375         CompressedStack methods.
376         * WaitHandle.cs: Added LinkDemand and InheritanceDemand for 
377         UnmanagedCode on set Handle property.
378
379 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
380
381         * Thread.cs: Make slothash a ThreadStatic field. Fixes #65414.
382
383 2005-02-21  Zoltan Varga  <vargaz@freemail.hu>
384
385         * Monitor.cs Interlocked.cs: Add net 2.0 ReliabilityContractAttributes.
386
387 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
388
389         * Interlocked.cs: Applied patch from Luca Barbieri (luca.barbieri@gmail.com). Add NET 2.0 methods.
390
391 Tue Feb 15 18:19:11 CET 2005 Paolo Molaro <lupus@ximian.com>
392
393         * Thread.cs: make the slothash a field in MonoThread.
394
395 2005-01-27  Sebastien Pouliot  <sebastien@ximian.com>
396
397         * Overlapped.cs: Added check for ControlPolicy and ControlEvidence for
398         Unsafe pack. Added MonoTODO for missing security stack propagation.
399         * Thread.cs: Add security checks for ControlThread.
400         * ThreadPool.cs: Added declarative security checks.
401
402 Thu Jan 13 18:15:32 CET 2005 Paolo Molaro <lupus@ximian.com>
403
404         * Thread.cs: implement stacksize and parameterized
405         start functionality (requires matching runtime).
406
407 2005-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
408
409         * ThreadAbortException.cs: added private serialization .ctor.
410
411 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
412
413         * CompressedStack.cs: Implemented most todo so it's usable for CAS.
414         * CompressedStackSwitcher.cs: Implemented most todo.
415         * Thread.cs: Implement support for getting/setting CompressedStack.
416
417 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
418
419         * Thread.cs: Change type of culture_info and ui_culture_info to 
420         IntPtr. Implement correct culture handling for the UI culture as
421         well.
422
423 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
424
425         * Thread.cs: Optimize CurrentCulture to avoid initializing the
426         serialization infrastructure in the common case when the culture is
427         not set explicitly.
428
429 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
430
431         * Thread.cs: Add new fields 'serialized_culture_info{_len}'.
432         
433         * Thread.cs (CurrentCulture): Fix leaking of culture info objects 
434         across appdomains. Partially fixes #50049.
435
436 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
437
438         * AutoResetEvent.cs (Set, Reset): If we are disposed, throw a
439         ObjectDisposedEvent, helped track the WebConnection destructor
440         issue. 
441
442 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
443
444         * Timer.cs: don't invoke the callback twice when the timer changes.
445         Fixes bug #66116.
446
447 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
448
449         * Interlocked.cs: Class is static in NET_2_0.
450
451 2004-09-04  Sebastien Pouliot  <sebastien@ximian.com>
452
453         * Thread.cs: Changed an imperative security demand to declarative
454         (unsupported) so it doesn't (for now) call the security runtime.
455
456 2004-08-20  Sebastien Pouliot  <sebastien@ximian.com>
457
458         * Thread.cs: Added Fx 2.0 properties/methods/attributes.
459
460 2004-08-12  Sebastien Pouliot  <sebastien@ximian.com>
461
462         * CompressedStackSwitcher.cs: Added missing [ComVisible] and 
463         [ReliabilityContract] attributes.
464         * ExecutionContext.cs: Added missing [ComVisible] and 
465         [Serializable] attributes.
466         * HostExecutionContext.cs: Added missing [ComVisible] attribute.
467         * HostExecutionContextManager.cs: Added missing [ComVisible] and 
468         [ReliabilityContract] attributes.
469         * HostExecutionContextSwitcher.cs: Added missing Equals and 
470         GetHashCode methods and [ComVisible] and [ReliabilityContract] attrs.
471         * ParameterizedThreadStart.cs: New delegate in NET_2_0.
472         * SendOrPostCallback.cs: Added missing [ComVisible] attribute.
473         * SynchronizationContext.cs: Added new (2.0 beta1) methods Copy and
474         WaitHelper. Added missing [ComVisible] and [ReliabilityContract] attrs.
475         * SynchronizationContextSwitcher.cs: Added missing [ComVisible] and 
476         [ReliabilityContract] attributes.
477
478 2004-08-08  Sebastien Pouliot  <sebastien@ximian.com>
479
480         * HostExecutionContext.cs: Fx 2.0 stub required for AppDomain.
481         * HostExecutionContextManager.cs: Fx 2.0 stub required for AppDomain.
482         * HostExecutionContextSwitcher.cs: Fx 2.0 stub required for AppDomain.
483
484 2004-08-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
485
486         * Timer.cs: don't invoke the callback if the period changes before the
487         due time. Fixes bug #62421.
488
489 2004-07-27  Lluis Sanchez Gual  <lluis@novell.com>
490
491         * ExecutionContext.cs, ExecutionContextSwitcher.cs, 
492           SynchronizationContext.cs, SynchronizationContextSwitcher.cs: Added
493           2.0 stubs.
494
495 2004-07-15  Dick Porter  <dick@ximian.com>
496
497         * Thread.cs: Hold a lock in GetNamedDataSlot.  Fixes bug 61582,
498         based on patch by Sbastien Robitaille
499         (sebastien.robitaille@croesus.com).  Also fix instances of
500         lock(typeof(Thread)) to lock a private object instead.
501
502 2004-07-14  Sebastien Pouliot  <sebastien@ximian.com>
503
504         * AsyncFlowControl.cs: New structure in Fx 2.0 required in 
505         System.Security namespace.
506         * CompressedStackSwitcher.cs: New structure in Fx 2.0 required in 
507         System.Security namespace.
508         * ContextCallback.cs: New delegate in Fx 2.0 required in 
509         System.Security namespace.
510         * CompressedStack.cs: Updated API for NET_2_0 profile.
511
512 2004-07-10  Lluis Sanchez Gual  <lluis@ximian.com>
513
514         * SendOrPostCallback.cs: New delegate.
515
516 2004-06-24  Dick Porter  <dick@ximian.com>
517
518         * Mutex.cs: Implement the createdNew parameter
519
520 2004-06-15  Gert Driesen <drieseng@users.sourceforge.net>
521
522         * Thread.cs: changed return type of VolatileRead to UIntPtr
523         * ThreadPool.cs: set return type of SetMinThreads to bool
524
525 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
526
527         * Thread.cs: Added new fields to keep sync with MonoThread.
528           Removed state changes in Sleep and Join. The state change is now done
529           in the icall. For accessing to internal fields lock with synch_lock
530           instead of this, which can be a source of deadlocks.
531
532 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
533
534         * Timer.cs: Don't abort the thread if Dispose() is called from the runner
535           thread.
536
537 2004-06-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
538
539         * Thread.cs:
540         (CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set
541         the thread IPrincipal if we get it from the AppDomain.
542
543 2004-06-09  Gert Driesen <drieseng@users.sourceforge.net>
544
545         * CompressedStack.cs: Added finalizer to match public API of
546         MS.NET
547
548 2004-05-19  Lluis Sanchez Gual <lluis@ximian.com>
549
550         * Thread.cs: Some fixes in Abort. Implemented Suspend and Resume.
551           Added internal interruption_requested field.
552
553 2004-05-13  Sebastien Pouliot  <sebastien@ximian.com>
554
555         * CompressedStack.cs: Added an internal constructor so a default one
556         doesn't appear with corcompare.
557         * Thread.cs: Added missing MemoryBarrier (only for 1.1) and SpinWait to please
558         corcompare. Both throw a NotImplementedException.
559         * ThreadPool.cs: Added missing UnsafeRegisterWaitForSingleObject methods (4
560         overloads) to please corcompare. All throw a NotImplementedException.
561
562 2004-05-12  Zoltan Varga  <vargaz@freemail.hu>
563
564         * CompressedStack.cs: New file.
565
566 2004-04-15  Lluis Sanchez Gual <lluis@ximian.com>
567
568         * ThreadPool.cs: Added GetMinThreads and SetMinThreads.
569         * Timer.cs: In Change, return false if the timer has been disposed.
570         In Dispose, notify the WaitHandle.
571
572 2004-04-11  Lluis Sanchez Gual <lluis@ximian.com>
573
574         * ReaderWriterLock.cs: More fixes: never wait where acquiring a reader lock
575           if the thread already has the lock. Added readyWaitingReaders variable to
576           keep track of threads ready to get the reader lock.
577
578 2004-04-11  Lluis Sanchez Gual <lluis@ximian.com>
579
580         * LockQueue.cs: Moved lockCount change inside the rwlock lock. Removed
581           lock(this) when entering the rwlock to avoid a deadlock.
582         * ReaderWriterLock.cs: In AcquireWriterLock, queue the thread if the queue
583           is not empty (even if state==0).
584
585 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
586
587         * Timer.cs: Call the callback immediately if dueTime is 0. Fixes
588         #56728.
589
590 2004-04-08  Jackson Harper  <jackson@ximian.com>
591
592         * ReaderWriterLock.cs: Fix tyop
593         
594 2004-04-08  Lluis Sanchez Gual <lluis@ximian.com>
595
596         * ReaderWriterLock.cs: Changed some methods to private.
597         * WaitHandle.cs: In Wait methods, release the synchronization context when 
598           exitContext is true.
599
600 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
601
602         * Timer.cs: call Abort on the Runner instance too.
603
604 2004-04-07  Jackson Harper  <jackson@ximian.com>
605
606         * Thread.cs: Use new culture info method for constructing the
607         current culture.
608         
609 2004-04-07  Lluis Sanchez Gual <lluis@ximian.com>
610
611         * ReaderWriterLock.cs: When a thread holds a writer lock, a call to
612           AcquireReaderLock works like a call to AcquireWriterLock.
613
614 2004-04-06  Lluis Sanchez Gual <lluis@ximian.com>
615
616         * Monitor.cs: In Wait(), release the synchronization context when 
617           exitContext is true.
618
619 2004-04-06  Lluis Sanchez Gual <lluis@ximian.com>
620
621         * LockCookie.cs: Keep in this class the count of reader or writer locks
622           for a thread, not only whether it has locks or not.
623         * LockQueue.cs: Added property for checking if a thread is waiting in
624           the queue. Wait now returns a boolean that set to false on timeout 
625           expiration.
626         * ReaderWriterLock.cs: Started fixing bugs but I had to rewrite a lot of it.
627           The main change is that now it keeps a reader lock count for each
628           thread. This is needed since methods like ReleaseLock or 
629           UpgradeToWriterLock need to return a per-thread status in LockCookie.
630           Also added support for recursive writer-lock requests.
631
632 2004-03-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
633
634         * ThreadAbortException.cs: use same HResult as MS.
635         * Timer.cs: abort the running thread when disposing the Timer. This
636         fixes NullRefs when finishing xsp.
637
638 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
639
640         * NativeOverlapped.cs: added 2 new internal fields.
641         * Overlapped.cs: implemented, but it's not used.
642
643         * ThreadPool.cs: implemented BindHandle.
644
645 2004-03-08  Zoltan Varga  <vargaz@freemail.hu>
646
647         * Timer.cs (Dispose): Applied patch from Jaroslaw Kowalski 
648         (jaak@zd.com.pl). Fix finalization problems during appdomain unload.
649
650 2004-02-23  Jackson Harper <jackson@ximian.com>
651
652         * LockCookie.cs: Add some fields for restoring locks.
653         * ReaderWriterLock.cs: Implement
654         * LockQueue.cs: New File - used for queueing thread locks in
655         ReaderWriterLock.
656         
657 2004-02-19  Jackson Harper <jackson@ximian.com>
658
659         * Monitor.cs: Fix spelleng.
660         
661 2004-02-09  Zoltan Varga  <vargaz@freemail.hu>
662
663         * Thread.cs: Add fields added to unmanaged MonoThread here as well.
664         Fixes random errors caused by memory corruption.
665
666 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
667
668         * Thread.cs: Store the thread name in unmanaged memory, since the
669         thread object is shared between appdomains.
670
671 2004-02-05  Sebastien Pouliot  <sebastien@ximian.com>
672
673         * Thread.cs: Implemented CurrentPrincipal.
674
675 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
676
677         * Thread.cs: delayed thread creation until Start is called. If we
678         don't do that and Start() is not called, the thread is leaked. First
679         step towards fixing bug #53078. 
680
681 2003-12-02  Dick Porter  <dick@ximian.com>
682
683         * Thread.cs: Throw InvalidOperationException if Thread.Name is
684         already set.
685
686 2003-12-01  Dick Porter  <dick@ximian.com>
687
688         * Thread.cs: Implement CurrentCulture and CurrentUICulture
689
690 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
691
692         * Thread.cs: Add new VolatileRead/VolatileWrite methods from 1.1
693
694 2003-10-23  Lluis Sanchez Gual  <lluis@ximian.com>
695
696         * Thread.cs: Added ResetDataStoreStatus and RestoreDataStoreStatus
697           methods. They are used in CrossAppDomainChannel to save and restore
698           thread's local data when switching between domains.
699
700 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
701
702         * ManualResetEvent.cs: added check for disposed.
703         * Thread.cs: no need to init this field.
704
705 2003-10-01  Zoltan Varga  <vargaz@freemail.hu>
706
707         * Thread.cs: Add locking to AllocateNamedDataSlot and 
708         FreeNamedDataSlot.
709
710 Wed Aug 20 12:01:36 CEST 2003 Paolo Molaro <lupus@ximian.com>
711
712         * Thread.cs: put all the fields at the start and add
713         more fields needed by the runtime.
714
715 2003-08-14  Lluis Sanchez Gual  <lluis@ximian.com>
716
717         * Thread.cs: SetData() method: use Hashtable.Contains to check
718           if a dataslot has been allocated (value could be null).
719
720 2003-07-23  Duncan Mak  <duncan@ximian.com>
721
722         * WaitHandle.cs (CheckDisposed): This method is not in the public
723         API, mark it as 'internal'.
724
725 2003-07-01  Dick Porter  <dick@ximian.com>
726
727         * Thread.cs: Throw an exception if thread creation failed.
728         (Better than just blowing up later.)
729
730 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
731
732         * ThreadPool.cs: use async delegate invoke.
733
734 2003-06-25  Dick Porter  <dick@ximian.com>
735
736         * WaitHandle.cs: Default handle value should be InvalidHandle, not
737         Zero.
738
739 2003-06-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
740
741         * ThreadPool.cs: correctly create a TimeSpan with provided the number of
742         milliseconds.
743
744         * WaitHandle.cs: fixes for WaitAny/All and TimeSpan.
745
746 2003-06-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
747
748         * WaitHandle.cs: checks and exceptions.
749
750 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
751
752         * NativeEventCalls.cs: added CloseEvent_intenal.
753         * WaitHandle.cs: call CloseEvent_internal when disposing.
754
755 2003-05-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
756
757         * RegisteredWaitHandle.cs: check that the callback is not null before
758         invoking.
759
760         * ThreadPool.cs: fixed timeout -> TimeSpan conversions (closes bug
761         #43963). Queue the item before setting the handle. If there's a timeout,
762         avoid trying to Dequeue, getting the exception et al, just continue the
763         loop.
764
765 Mon May 19 09:07:45 CEST 2003 Paolo Molaro <lupus@ximian.com>
766
767         * Monitor.cs: removed test_owner, the check is already done in the
768         icall.
769
770 Tue May 13 15:34:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
771
772         * Thread.cs: added missing field used by the runtime and
773         a new field to support thread-static data.
774
775 2003-04-17  Pedro Mart?ez Juli? <yoros@wanadoo.es>
776
777         * Timer.cs: Change the position of two lines because they were
778         before the "if" that ensures the integrity. After this, the first of
779         that two lines was producing a NullReferenceException.
780
781 2003-04-09  Dick Porter  <dick@ximian.com>
782
783         * Thread.cs: Make sure a reference to the ThreadStart delegate is
784         held.  There's no telling how long it will be before
785         Thread.Start() is called, and GC might destroy the delegate.
786         Thread() and Start() need to be rewritten so that the runtime
787         creates the new thread when Start() is called, which will simplify
788         the code a great deal.
789
790 2003-03-20  Miguel de Icaza  <miguel@ximian.com>
791
792         * Thread.cs (CurrentCuluture): use the invaraint culture instead
793         of "" for the current_culture setting.
794
795 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
796
797         * Thread.cs: Fix visibility of ResetAbort().
798
799 2003-03-18  Dick Porter  <dick@ximian.com>
800
801         * Thread.cs: Keep the thread state updated in all the places that
802         require it.  (Suspend, Resume and Interrupt not handled yet)
803
804 2003-03-03  Lluis Sanchez Gual <lluis@ideary.com>
805
806         * Thread.cs: Changed implementation of CurrentContext, adapted to the changes
807           in the runtime.
808
809 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
810
811         * Thread.cs: implemented CurrentContext.
812
813 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
814
815         * Thread.cs: made the thread_id for the current thread accesible through
816         an internal property.  
817
818 2003-02-17  Dick Porter  <dick@ximian.com>
819
820         * Thread.cs: Added the Start semaphore field to the class.  Update
821         the thread state after Start() has returned, not before.
822
823 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
824
825         * Thread.cs (Sleep): Timeout.Infinite is a value argument.
826
827 2003-02-11  Dick Porter  <dick@ximian.com>
828
829         * Monitor.cs: Infinite wait is Infinite, not 0 ms
830
831 2003-02-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
832
833         * Thread.cs: fixed bug #37759.
834
835 2003-02-07  Patrik Torstensson
836
837         * Timer.cs: Set the Background thread flag for the timer thread
838
839 2003-02-05  Patrik Torstensson
840
841         * ThreadPool.cs: Reformated and fixed issue that made all thread exit the pool. 
842
843 2003-02-04  Lluis Sanchez Gual <lluis@ideary.com>
844
845         * ThreadPool.cs: Implemented RegisterWaitForSingleObject methods.
846
847 Tue Jan 28 17:55:59 CET 2003 Paolo Molaro <lupus@ximian.com>
848
849         * Thread.cs: delay-init datastorehash.
850
851 2003-01-10  Patrik Torstensson  <totte@race-x-change.com>
852
853         * ThreadPool.cs: Temporary removed the usage of monitor thread, implemented a 
854                     model more equal to the MS one.
855
856 2002-12-10  Dick Porter  <dick@ximian.com>
857
858         * Monitor.cs:
859         * Thread.cs:
860         * ThreadPool.cs:
861         * Timer.cs:
862         * WaitHandle.cs: Use TotalMilliseconds to convert a TimeSpan to
863         ms, not Milliseconds.
864
865 2002-12-07  Martin Baulig  <martin@ximian.com>
866
867         * Timer.cs: Make it actually work; now it no longer sets your
868         application on fire if you use a zero periode and Timer.Change()
869         actually works.
870
871 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
872
873         * Timer.cs: implemented more stuff. It works now.
874
875 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
876
877         * Thread.cs: Implement GetDomain() and GetDomainID().
878
879 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
880
881         * ThreadPool.cs: now the monitor thread is not sleeping and checking if
882         more worker threads needed. It waits on _DataInQueue. If (and only if)
883         there's data in the queue it checks if more worker threads needed and
884         then sleeps 0.5s before waiting for queued data again.
885
886 2002-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
887
888         * ThreadPool.cs: set IsThreadPoolThread before starting the worker.
889
890 2002-09-11  Dick Porter  <dick@ximian.com>
891
892         * Mutex.cs: 
893         * ManualResetEvent.cs: 
894         * AutoResetEvent.cs: Use the WaitHandle.Handle property instead of
895         the private field
896
897         * WaitHandle.cs: Hide the os_handle field and the WaitOne_internal
898         method
899
900 2002-09-03  Dick Porter  <dick@ximian.com>
901
902         * Thread.cs: Added thread ID field
903
904 2002-08-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
905
906         * WaitHandle.cs: IDisposable fixes.
907
908 2002-08-14  Dick Porter  <dick@ximian.com>
909
910         * Thread.cs: Make CurrentUICulture act the same as CurrentCulture
911         for now.
912
913 2002-08-12  Dietmar Maurer  <dietmar@ximian.com>
914
915         * ThreadAbortException.cs: impl. ExceptionState property.
916
917         * Thread.cs: moved all instance variables to the start of the
918         class. added support for Thread::Abort()
919
920 2002-04-30  Dick Porter  <dick@ximian.com>
921
922         * Thread.cs: If LocalDataStoreSlot already has data set, remove it
923         before adding a new one.
924
925         Use the Thread object destructor to tell the runtime to close the
926         thread handle.
927
928 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
929
930         * Interlocked.cs: made all methods icalls.
931
932 2002-04-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
933
934         * IOCompletionCallback.cs: added attributes to the delegate
935         (CLSCompliant(false) and Serializable).
936
937 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
938         * Thread.cs: Fixed IsThreadPoolThread to use a internal property instead of extending 
939                                  the threadstate enum.
940         * ThreadPool.cs: Now using the internal Isthreadpoolthread property
941         * ThreadState.cs: removed non-standard enum (ThreadPoolThread)
942
943 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
944
945         * ThreadState.cs: Added enum for threadpool thread
946         * Thread.cs: changed the set/clr_state to be internal (used from threadpool)
947         * Thread.cs: Added IsThreadPoolThread
948         * ThreadPool.cs: Implementation of QueueUserWorkItem
949
950 Wed Feb 13 21:51:30 CET 2002 Paolo Molaro <lupus@ximian.com>
951
952         * Thread.cs: implement CurrentCulture property needed by
953         Convert.ChangeType() (used when compiling enums).
954
955 2002-01-23  Dick Porter  <dick@ximian.com>
956
957         * ManualResetEvent.cs: 
958         * AutoResetEvent.cs: Fixed DOS line endings
959
960 2002-01-22  Veronica De Santis <veron78@interfree.it>   
961         
962         * NativeEventCalls : Class that contains internal calls shared by Auto 
963                              and Manual Reset Events
964         * AutoResetEvents.cs : Added class AutoResetEvents and its implementation
965         * ManualResetEvents.cs : Added class ManualResetEvents and its implementation
966
967 2002-01-16  Veronica De Santis <veron78@interfree.it>   
968         
969         * WaitHandle.cs : Renamed handle to os_handle and make it protected
970                           instead of private.
971         * Mutex.cs : Write the System.Threading.Mutex methods ( constructors 
972                      and the ReleaseMutex)
973
974 2002-01-15  Dick Porter  <dick@ximian.com>
975
976         * WaitHandle.cs:
977         * Thread.cs: Make the runtime's idea of infinite timeouts coincide
978         with the class library's
979
980 2002-01-10  Dick Porter  <dick@ximian.com>
981
982         * WaitHandle.cs: Added checks for too many handles and null
983         handles in WaitAll() and WaitAny
984         
985
986 2002-01-05  Ravi Pratap  <ravi@ximian.com>
987
988         * AutoResetEvent.cs, ManualResetEvent.cs, Monitor.cs : MonoTODO
989         decoration.
990
991         * Mutex.cs, Overlapped.cs, ReaderWriterLock.cs, RegisteredWaitHandle.cs,
992         Thread.cs, ThreadAbortException.cs, ThreadPool.cs, Timer.cs, WaitHandler.cs : Ditto.
993
994 2001-12-11  Dick Porter  <dick@ximian.com>
995
996         * WaitHandle.cs: Implemented WaitAll(), WaitAny() and WaitOne() as
997         internal calls.
998
999 2001-11-26  Dick Porter  <dick@ximian.com>
1000
1001         * Thread.cs: DataSlot uses a single system TLS slot, and a
1002         hashtable per thread.  Some minor changes to reflect the new
1003         internal calls using the new IO library, and the newly-supported
1004         bool returns from internal calls.
1005
1006         * Monitor.cs: Use bool returns from internal calls now they are
1007         supported by the runtime.  Coalesce enter with the try_enter
1008         internal call.
1009
1010 Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <lupus@ximian.com>
1011
1012         * Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.
1013
1014 2001-10-03  Dick Porter  <dick@ximian.com>
1015
1016         * Monitor.cs: Implemented all methods except the two Wait()
1017         methods that take boolean parameters
1018
1019 2001-09-28  Dick Porter  <dick@ximian.com>
1020
1021         * Thread.cs: Implemented AllocateDataSlot(),
1022         AllocateNamedDataSlot(), FreeNamedDataSlot(), GetData(),
1023         GetNamedDataSlot(), SetData(), IsBackground.  Reworked Thread()
1024         and Start() to avoid a race condition. Added thread-safe state
1025         changing private operations.
1026
1027         * Monitor.cs: Comment out the GetType() calls because it isn't implemented yet
1028
1029 2001-09-25  Dick Porter  <dick@ximian.com>
1030
1031         * Thread.cs: Implement Join and timed Join, set correct state
1032         around Start, Join and Sleep calls, implement IsAlive and
1033         ThreadState properties.
1034
1035         * ThreadState.cs (Threading): Added StopRequested,
1036         SuspendRequested, Suspended values
1037
1038 2001-09-23  Dick Porter  <dick@ximian.com>
1039
1040         * Thread.cs: Implemented CurrentThread and Sleep (both versions)
1041         with internal calls, and Name.
1042
1043 2001-09-21  Dick Porter  <dick@ximian.com>
1044
1045         * Thread.cs: Implement Thread(ThreadStart) constructor and Start()
1046         with an internal call
1047
1048         * WaitHandle.cs: Close calls Dispose(false)
1049
1050 2001-09-13  Dick Porter  <dick@ximian.com>
1051
1052         * ApartmentState.cs (Threading): Set the correct enum values
1053
1054 2001-09-13  Dick Porter  <dick@ximian.com>
1055
1056         * ApartmentState.cs, AutoResetEvent.cs, IOCompletionCallback.cs,
1057         Interlocked.cs, LockCookie.cs, ManualResetEvent.cs, Monitor.cs,
1058         Mutex.cs, NativeOverlapped.cs, Overlapped.cs, ReaderWriterLock.cs,
1059         RegisteredWaitHandle.cs, SynchronizationLockException.cs,
1060         Thread.cs, ThreadAbortException.cs, ThreadInterruptedException.cs,
1061         ThreadPool.cs, ThreadStart.cs, ThreadStateException.cs,
1062         Timeout.cs, Timer.cs, TimerCallback.cs, WaitCallback.cs,
1063         WaitHandle.cs, WaitOrTimerCallback.cs: System.Threading class
1064         stubs.
1065         
1066 2001-07-18  Michael Lambert <michaellambert@email.com>
1067
1068         * ThreadPriority.cs, ThreadState.cs: Add.