1 2004-12-06 Zoltan Varga <vargaz@freemail.hu>
3 * Thread.cs: Add new fields 'serialized_culture_info{_len}'.
5 * Thread.cs (CurrentCulture): Fix leaking of culture info objects
6 across appdomains. Partially fixes #50049.
8 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10 * AutoResetEvent.cs (Set, Reset): If we are disposed, throw a
11 ObjectDisposedEvent, helped track the WebConnection destructor
14 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16 * Timer.cs: don't invoke the callback twice when the timer changes.
19 2004-09-08 Marek Safar <marek.safar@seznam.cz>
21 * Interlocked.cs: Class is static in NET_2_0.
23 2004-09-04 Sebastien Pouliot <sebastien@ximian.com>
25 * Thread.cs: Changed an imperative security demand to declarative
26 (unsupported) so it doesn't (for now) call the security runtime.
28 2004-08-20 Sebastien Pouliot <sebastien@ximian.com>
30 * Thread.cs: Added Fx 2.0 properties/methods/attributes.
32 2004-08-12 Sebastien Pouliot <sebastien@ximian.com>
34 * CompressedStackSwitcher.cs: Added missing [ComVisible] and
35 [ReliabilityContract] attributes.
36 * ExecutionContext.cs: Added missing [ComVisible] and
37 [Serializable] attributes.
38 * HostExecutionContext.cs: Added missing [ComVisible] attribute.
39 * HostExecutionContextManager.cs: Added missing [ComVisible] and
40 [ReliabilityContract] attributes.
41 * HostExecutionContextSwitcher.cs: Added missing Equals and
42 GetHashCode methods and [ComVisible] and [ReliabilityContract] attrs.
43 * ParameterizedThreadStart.cs: New delegate in NET_2_0.
44 * SendOrPostCallback.cs: Added missing [ComVisible] attribute.
45 * SynchronizationContext.cs: Added new (2.0 beta1) methods Copy and
46 WaitHelper. Added missing [ComVisible] and [ReliabilityContract] attrs.
47 * SynchronizationContextSwitcher.cs: Added missing [ComVisible] and
48 [ReliabilityContract] attributes.
50 2004-08-08 Sebastien Pouliot <sebastien@ximian.com>
52 * HostExecutionContext.cs: Fx 2.0 stub required for AppDomain.
53 * HostExecutionContextManager.cs: Fx 2.0 stub required for AppDomain.
54 * HostExecutionContextSwitcher.cs: Fx 2.0 stub required for AppDomain.
56 2004-08-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
58 * Timer.cs: don't invoke the callback if the period changes before the
59 due time. Fixes bug #62421.
61 2004-07-27 Lluis Sanchez Gual <lluis@novell.com>
63 * ExecutionContext.cs, ExecutionContextSwitcher.cs,
64 SynchronizationContext.cs, SynchronizationContextSwitcher.cs: Added
67 2004-07-15 Dick Porter <dick@ximian.com>
69 * Thread.cs: Hold a lock in GetNamedDataSlot. Fixes bug 61582,
70 based on patch by Sébastien Robitaille
71 (sebastien.robitaille@croesus.com). Also fix instances of
72 lock(typeof(Thread)) to lock a private object instead.
74 2004-07-14 Sebastien Pouliot <sebastien@ximian.com>
76 * AsyncFlowControl.cs: New structure in Fx 2.0 required in
77 System.Security namespace.
78 * CompressedStackSwitcher.cs: New structure in Fx 2.0 required in
79 System.Security namespace.
80 * ContextCallback.cs: New delegate in Fx 2.0 required in
81 System.Security namespace.
82 * CompressedStack.cs: Updated API for NET_2_0 profile.
84 2004-07-10 Lluis Sanchez Gual <lluis@ximian.com>
86 * SendOrPostCallback.cs: New delegate.
88 2004-06-24 Dick Porter <dick@ximian.com>
90 * Mutex.cs: Implement the createdNew parameter
92 2004-06-15 Gert Driesen <drieseng@users.sourceforge.net>
94 * Thread.cs: changed return type of VolatileRead to UIntPtr
95 * ThreadPool.cs: set return type of SetMinThreads to bool
97 2004-06-15 Lluis Sanchez Gual <lluis@ximian.com>
99 * Thread.cs: Added new fields to keep sync with MonoThread.
100 Removed state changes in Sleep and Join. The state change is now done
101 in the icall. For accessing to internal fields lock with synch_lock
102 instead of this, which can be a source of deadlocks.
104 2004-06-15 Lluis Sanchez Gual <lluis@ximian.com>
106 * Timer.cs: Don't abort the thread if Dispose() is called from the runner
109 2004-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
112 (CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set
113 the thread IPrincipal if we get it from the AppDomain.
115 2004-06-09 Gert Driesen <drieseng@users.sourceforge.net>
117 * CompressedStack.cs: Added finalizer to match public API of
120 2004-05-19 Lluis Sanchez Gual <lluis@ximian.com>
122 * Thread.cs: Some fixes in Abort. Implemented Suspend and Resume.
123 Added internal interruption_requested field.
125 2004-05-13 Sebastien Pouliot <sebastien@ximian.com>
127 * CompressedStack.cs: Added an internal constructor so a default one
128 doesn't appear with corcompare.
129 * Thread.cs: Added missing MemoryBarrier (only for 1.1) and SpinWait to please
130 corcompare. Both throw a NotImplementedException.
131 * ThreadPool.cs: Added missing UnsafeRegisterWaitForSingleObject methods (4
132 overloads) to please corcompare. All throw a NotImplementedException.
134 2004-05-12 Zoltan Varga <vargaz@freemail.hu>
136 * CompressedStack.cs: New file.
138 2004-04-15 Lluis Sanchez Gual <lluis@ximian.com>
140 * ThreadPool.cs: Added GetMinThreads and SetMinThreads.
141 * Timer.cs: In Change, return false if the timer has been disposed.
142 In Dispose, notify the WaitHandle.
144 2004-04-11 Lluis Sanchez Gual <lluis@ximian.com>
146 * ReaderWriterLock.cs: More fixes: never wait where acquiring a reader lock
147 if the thread already has the lock. Added readyWaitingReaders variable to
148 keep track of threads ready to get the reader lock.
150 2004-04-11 Lluis Sanchez Gual <lluis@ximian.com>
152 * LockQueue.cs: Moved lockCount change inside the rwlock lock. Removed
153 lock(this) when entering the rwlock to avoid a deadlock.
154 * ReaderWriterLock.cs: In AcquireWriterLock, queue the thread if the queue
155 is not empty (even if state==0).
157 2004-04-09 Zoltan Varga <vargaz@freemail.hu>
159 * Timer.cs: Call the callback immediately if dueTime is 0. Fixes
162 2004-04-08 Jackson Harper <jackson@ximian.com>
164 * ReaderWriterLock.cs: Fix tyop
166 2004-04-08 Lluis Sanchez Gual <lluis@ximian.com>
168 * ReaderWriterLock.cs: Changed some methods to private.
169 * WaitHandle.cs: In Wait methods, release the synchronization context when
172 2004-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
174 * Timer.cs: call Abort on the Runner instance too.
176 2004-04-07 Jackson Harper <jackson@ximian.com>
178 * Thread.cs: Use new culture info method for constructing the
181 2004-04-07 Lluis Sanchez Gual <lluis@ximian.com>
183 * ReaderWriterLock.cs: When a thread holds a writer lock, a call to
184 AcquireReaderLock works like a call to AcquireWriterLock.
186 2004-04-06 Lluis Sanchez Gual <lluis@ximian.com>
188 * Monitor.cs: In Wait(), release the synchronization context when
191 2004-04-06 Lluis Sanchez Gual <lluis@ximian.com>
193 * LockCookie.cs: Keep in this class the count of reader or writer locks
194 for a thread, not only whether it has locks or not.
195 * LockQueue.cs: Added property for checking if a thread is waiting in
196 the queue. Wait now returns a boolean that set to false on timeout
198 * ReaderWriterLock.cs: Started fixing bugs but I had to rewrite a lot of it.
199 The main change is that now it keeps a reader lock count for each
200 thread. This is needed since methods like ReleaseLock or
201 UpgradeToWriterLock need to return a per-thread status in LockCookie.
202 Also added support for recursive writer-lock requests.
204 2004-03-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
206 * ThreadAbortException.cs: use same HResult as MS.
207 * Timer.cs: abort the running thread when disposing the Timer. This
208 fixes NullRefs when finishing xsp.
210 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
212 * NativeOverlapped.cs: added 2 new internal fields.
213 * Overlapped.cs: implemented, but it's not used.
215 * ThreadPool.cs: implemented BindHandle.
217 2004-03-08 Zoltan Varga <vargaz@freemail.hu>
219 * Timer.cs (Dispose): Applied patch from Jaroslaw Kowalski
220 (jaak@zd.com.pl). Fix finalization problems during appdomain unload.
222 2004-02-23 Jackson Harper <jackson@ximian.com>
224 * LockCookie.cs: Add some fields for restoring locks.
225 * ReaderWriterLock.cs: Implement
226 * LockQueue.cs: New File - used for queueing thread locks in
229 2004-02-19 Jackson Harper <jackson@ximian.com>
231 * Monitor.cs: Fix spelleng.
233 2004-02-09 Zoltan Varga <vargaz@freemail.hu>
235 * Thread.cs: Add fields added to unmanaged MonoThread here as well.
236 Fixes random errors caused by memory corruption.
238 2004-02-06 Zoltan Varga <vargaz@freemail.hu>
240 * Thread.cs: Store the thread name in unmanaged memory, since the
241 thread object is shared between appdomains.
243 2004-02-05 Sebastien Pouliot <sebastien@ximian.com>
245 * Thread.cs: Implemented CurrentPrincipal.
247 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
249 * Thread.cs: delayed thread creation until Start is called. If we
250 don't do that and Start() is not called, the thread is leaked. First
251 step towards fixing bug #53078.
253 2003-12-02 Dick Porter <dick@ximian.com>
255 * Thread.cs: Throw InvalidOperationException if Thread.Name is
258 2003-12-01 Dick Porter <dick@ximian.com>
260 * Thread.cs: Implement CurrentCulture and CurrentUICulture
262 2003-11-12 Miguel de Icaza <miguel@ximian.com>
264 * Thread.cs: Add new VolatileRead/VolatileWrite methods from 1.1
266 2003-10-23 Lluis Sanchez Gual <lluis@ximian.com>
268 * Thread.cs: Added ResetDataStoreStatus and RestoreDataStoreStatus
269 methods. They are used in CrossAppDomainChannel to save and restore
270 thread's local data when switching between domains.
272 2003-10-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
274 * ManualResetEvent.cs: added check for disposed.
275 * Thread.cs: no need to init this field.
277 2003-10-01 Zoltan Varga <vargaz@freemail.hu>
279 * Thread.cs: Add locking to AllocateNamedDataSlot and
282 Wed Aug 20 12:01:36 CEST 2003 Paolo Molaro <lupus@ximian.com>
284 * Thread.cs: put all the fields at the start and add
285 more fields needed by the runtime.
287 2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
289 * Thread.cs: SetData() method: use Hashtable.Contains to check
290 if a dataslot has been allocated (value could be null).
292 2003-07-23 Duncan Mak <duncan@ximian.com>
294 * WaitHandle.cs (CheckDisposed): This method is not in the public
295 API, mark it as 'internal'.
297 2003-07-01 Dick Porter <dick@ximian.com>
299 * Thread.cs: Throw an exception if thread creation failed.
300 (Better than just blowing up later.)
302 2003-06-27 Dietmar Maurer <dietmar@ximian.com>
304 * ThreadPool.cs: use async delegate invoke.
306 2003-06-25 Dick Porter <dick@ximian.com>
308 * WaitHandle.cs: Default handle value should be InvalidHandle, not
311 2003-06-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
313 * ThreadPool.cs: correctly create a TimeSpan with provided the number of
316 * WaitHandle.cs: fixes for WaitAny/All and TimeSpan.
318 2003-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
320 * WaitHandle.cs: checks and exceptions.
322 2003-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
324 * NativeEventCalls.cs: added CloseEvent_intenal.
325 * WaitHandle.cs: call CloseEvent_internal when disposing.
327 2003-05-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
329 * RegisteredWaitHandle.cs: check that the callback is not null before
332 * ThreadPool.cs: fixed timeout -> TimeSpan conversions (closes bug
333 #43963). Queue the item before setting the handle. If there's a timeout,
334 avoid trying to Dequeue, getting the exception et al, just continue the
337 Mon May 19 09:07:45 CEST 2003 Paolo Molaro <lupus@ximian.com>
339 * Monitor.cs: removed test_owner, the check is already done in the
342 Tue May 13 15:34:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
344 * Thread.cs: added missing field used by the runtime and
345 a new field to support thread-static data.
347 2003-04-17 Pedro Mart�ez Juli� <yoros@wanadoo.es>
349 * Timer.cs: Change the position of two lines because they were
350 before the "if" that ensures the integrity. After this, the first of
351 that two lines was producing a NullReferenceException.
353 2003-04-09 Dick Porter <dick@ximian.com>
355 * Thread.cs: Make sure a reference to the ThreadStart delegate is
356 held. There's no telling how long it will be before
357 Thread.Start() is called, and GC might destroy the delegate.
358 Thread() and Start() need to be rewritten so that the runtime
359 creates the new thread when Start() is called, which will simplify
360 the code a great deal.
362 2003-03-20 Miguel de Icaza <miguel@ximian.com>
364 * Thread.cs (CurrentCuluture): use the invaraint culture instead
365 of "" for the current_culture setting.
367 2003-03-25 Zoltan Varga <vargaz@freemail.hu>
369 * Thread.cs: Fix visibility of ResetAbort().
371 2003-03-18 Dick Porter <dick@ximian.com>
373 * Thread.cs: Keep the thread state updated in all the places that
374 require it. (Suspend, Resume and Interrupt not handled yet)
376 2003-03-03 Lluis Sanchez Gual <lluis@ideary.com>
378 * Thread.cs: Changed implementation of CurrentContext, adapted to the changes
381 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
383 * Thread.cs: implemented CurrentContext.
385 2003-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
387 * Thread.cs: made the thread_id for the current thread accesible through
388 an internal property.
390 2003-02-17 Dick Porter <dick@ximian.com>
392 * Thread.cs: Added the Start semaphore field to the class. Update
393 the thread state after Start() has returned, not before.
395 2003-02-13 Zoltan Varga <vargaz@freemail.hu>
397 * Thread.cs (Sleep): Timeout.Infinite is a value argument.
399 2003-02-11 Dick Porter <dick@ximian.com>
401 * Monitor.cs: Infinite wait is Infinite, not 0 ms
403 2003-02-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
405 * Thread.cs: fixed bug #37759.
407 2003-02-07 Patrik Torstensson
409 * Timer.cs: Set the Background thread flag for the timer thread
411 2003-02-05 Patrik Torstensson
413 * ThreadPool.cs: Reformated and fixed issue that made all thread exit the pool.
415 2003-02-04 Lluis Sanchez Gual <lluis@ideary.com>
417 * ThreadPool.cs: Implemented RegisterWaitForSingleObject methods.
419 Tue Jan 28 17:55:59 CET 2003 Paolo Molaro <lupus@ximian.com>
421 * Thread.cs: delay-init datastorehash.
423 2003-01-10 Patrik Torstensson <totte@race-x-change.com>
425 * ThreadPool.cs: Temporary removed the usage of monitor thread, implemented a
426 model more equal to the MS one.
428 2002-12-10 Dick Porter <dick@ximian.com>
434 * WaitHandle.cs: Use TotalMilliseconds to convert a TimeSpan to
435 ms, not Milliseconds.
437 2002-12-07 Martin Baulig <martin@ximian.com>
439 * Timer.cs: Make it actually work; now it no longer sets your
440 application on fire if you use a zero periode and Timer.Change()
443 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
445 * Timer.cs: implemented more stuff. It works now.
447 2002-10-25 Zoltan Varga <vargaz@freemail.hu>
449 * Thread.cs: Implement GetDomain() and GetDomainID().
451 2002-10-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
453 * ThreadPool.cs: now the monitor thread is not sleeping and checking if
454 more worker threads needed. It waits on _DataInQueue. If (and only if)
455 there's data in the queue it checks if more worker threads needed and
456 then sleeps 0.5s before waiting for queued data again.
458 2002-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
460 * ThreadPool.cs: set IsThreadPoolThread before starting the worker.
462 2002-09-11 Dick Porter <dick@ximian.com>
465 * ManualResetEvent.cs:
466 * AutoResetEvent.cs: Use the WaitHandle.Handle property instead of
469 * WaitHandle.cs: Hide the os_handle field and the WaitOne_internal
472 2002-09-03 Dick Porter <dick@ximian.com>
474 * Thread.cs: Added thread ID field
476 2002-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
478 * WaitHandle.cs: IDisposable fixes.
480 2002-08-14 Dick Porter <dick@ximian.com>
482 * Thread.cs: Make CurrentUICulture act the same as CurrentCulture
485 2002-08-12 Dietmar Maurer <dietmar@ximian.com>
487 * ThreadAbortException.cs: impl. ExceptionState property.
489 * Thread.cs: moved all instance variables to the start of the
490 class. added support for Thread::Abort()
492 2002-04-30 Dick Porter <dick@ximian.com>
494 * Thread.cs: If LocalDataStoreSlot already has data set, remove it
495 before adding a new one.
497 Use the Thread object destructor to tell the runtime to close the
500 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
502 * Interlocked.cs: made all methods icalls.
504 2002-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
506 * IOCompletionCallback.cs: added attributes to the delegate
507 (CLSCompliant(false) and Serializable).
509 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
510 * Thread.cs: Fixed IsThreadPoolThread to use a internal property instead of extending
511 the threadstate enum.
512 * ThreadPool.cs: Now using the internal Isthreadpoolthread property
513 * ThreadState.cs: removed non-standard enum (ThreadPoolThread)
515 2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
517 * ThreadState.cs: Added enum for threadpool thread
518 * Thread.cs: changed the set/clr_state to be internal (used from threadpool)
519 * Thread.cs: Added IsThreadPoolThread
520 * ThreadPool.cs: Implementation of QueueUserWorkItem
522 Wed Feb 13 21:51:30 CET 2002 Paolo Molaro <lupus@ximian.com>
524 * Thread.cs: implement CurrentCulture property needed by
525 Convert.ChangeType() (used when compiling enums).
527 2002-01-23 Dick Porter <dick@ximian.com>
529 * ManualResetEvent.cs:
530 * AutoResetEvent.cs: Fixed DOS line endings
532 2002-01-22 Veronica De Santis <veron78@interfree.it>
534 * NativeEventCalls : Class that contains internal calls shared by Auto
535 and Manual Reset Events
536 * AutoResetEvents.cs : Added class AutoResetEvents and its implementation
537 * ManualResetEvents.cs : Added class ManualResetEvents and its implementation
539 2002-01-16 Veronica De Santis <veron78@interfree.it>
541 * WaitHandle.cs : Renamed handle to os_handle and make it protected
543 * Mutex.cs : Write the System.Threading.Mutex methods ( constructors
544 and the ReleaseMutex)
546 2002-01-15 Dick Porter <dick@ximian.com>
549 * Thread.cs: Make the runtime's idea of infinite timeouts coincide
550 with the class library's
552 2002-01-10 Dick Porter <dick@ximian.com>
554 * WaitHandle.cs: Added checks for too many handles and null
555 handles in WaitAll() and WaitAny
558 2002-01-05 Ravi Pratap <ravi@ximian.com>
560 * AutoResetEvent.cs, ManualResetEvent.cs, Monitor.cs : MonoTODO
563 * Mutex.cs, Overlapped.cs, ReaderWriterLock.cs, RegisteredWaitHandle.cs,
564 Thread.cs, ThreadAbortException.cs, ThreadPool.cs, Timer.cs, WaitHandler.cs : Ditto.
566 2001-12-11 Dick Porter <dick@ximian.com>
568 * WaitHandle.cs: Implemented WaitAll(), WaitAny() and WaitOne() as
571 2001-11-26 Dick Porter <dick@ximian.com>
573 * Thread.cs: DataSlot uses a single system TLS slot, and a
574 hashtable per thread. Some minor changes to reflect the new
575 internal calls using the new IO library, and the newly-supported
576 bool returns from internal calls.
578 * Monitor.cs: Use bool returns from internal calls now they are
579 supported by the runtime. Coalesce enter with the try_enter
582 Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <lupus@ximian.com>
584 * Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.
586 2001-10-03 Dick Porter <dick@ximian.com>
588 * Monitor.cs: Implemented all methods except the two Wait()
589 methods that take boolean parameters
591 2001-09-28 Dick Porter <dick@ximian.com>
593 * Thread.cs: Implemented AllocateDataSlot(),
594 AllocateNamedDataSlot(), FreeNamedDataSlot(), GetData(),
595 GetNamedDataSlot(), SetData(), IsBackground. Reworked Thread()
596 and Start() to avoid a race condition. Added thread-safe state
597 changing private operations.
599 * Monitor.cs: Comment out the GetType() calls because it isn't implemented yet
601 2001-09-25 Dick Porter <dick@ximian.com>
603 * Thread.cs: Implement Join and timed Join, set correct state
604 around Start, Join and Sleep calls, implement IsAlive and
605 ThreadState properties.
607 * ThreadState.cs (Threading): Added StopRequested,
608 SuspendRequested, Suspended values
610 2001-09-23 Dick Porter <dick@ximian.com>
612 * Thread.cs: Implemented CurrentThread and Sleep (both versions)
613 with internal calls, and Name.
615 2001-09-21 Dick Porter <dick@ximian.com>
617 * Thread.cs: Implement Thread(ThreadStart) constructor and Start()
618 with an internal call
620 * WaitHandle.cs: Close calls Dispose(false)
622 2001-09-13 Dick Porter <dick@ximian.com>
624 * ApartmentState.cs (Threading): Set the correct enum values
626 2001-09-13 Dick Porter <dick@ximian.com>
628 * ApartmentState.cs, AutoResetEvent.cs, IOCompletionCallback.cs,
629 Interlocked.cs, LockCookie.cs, ManualResetEvent.cs, Monitor.cs,
630 Mutex.cs, NativeOverlapped.cs, Overlapped.cs, ReaderWriterLock.cs,
631 RegisteredWaitHandle.cs, SynchronizationLockException.cs,
632 Thread.cs, ThreadAbortException.cs, ThreadInterruptedException.cs,
633 ThreadPool.cs, ThreadStart.cs, ThreadStateException.cs,
634 Timeout.cs, Timer.cs, TimerCallback.cs, WaitCallback.cs,
635 WaitHandle.cs, WaitOrTimerCallback.cs: System.Threading class
638 2001-07-18 Michael Lambert <michaellambert@email.com>
640 * ThreadPriority.cs, ThreadState.cs: Add.