2002-06-25 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
1 2002-06-25  Dick Porter  <dick@ximian.com>
2
3         * handles.c:
4         * handles-private.h:
5         * daemon-messages.h:
6         * daemon.c: Process forking and handle data management
7
8         * processes.h:
9         * process-private.h:
10         * processes.c: Process forking and other support functions
11
12 2002-06-25  Dick Porter  <dick@ximian.com>
13
14         * versioninfo.h: PE resource decoding
15
16         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
17         to be told the string length
18
19         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
20         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
21         timefuncs.c
22
23 2002-06-12  Dick Porter  <dick@ximian.com>
24
25         * daemon.c: 
26         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
27         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
28         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
29
30 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
31
32         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
33         when writing to a closed socket.
34
35 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
36
37         * mono-mutex.c (mono_once): New convenience function for my
38         previous fix.
39
40         * handles.c:
41         * error.c: 
42         * critical-sections.c: 
43         * threads.c: 
44         * sockets.c: 
45         * semaphores.c: 
46         * processes.c: 
47         * mutexes.c: 
48         * io.c: 
49         * events.c: 
50         * atomic.c: Use mono_once() rather than pthread_once().
51
52 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
53
54         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
55         if multiple threads all try to call _wapi_handle_new() before the
56         shared data has been initialized, it is possible that we could get
57         into a condition where shared_init() is being executed and later
58         threads will pass by pthread_once() due to the fact that it has
59         already been called and so therefor will attempt to use the shared
60         data before it has been completely initialized. If we instead use
61         a standard mutex locking mechanism around shared_init(), we can
62         avoid the situation entirely. By wrapping the mutex locking in a
63         check to see if we've already initialized the data, we can even
64         avoid wasting resources by having to lock/unlock the mutex in any
65         later calls (the only time we'd have to worry about
66         locking/unlocking is the initial race to call shared_init() at
67         startup).
68
69 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
70
71         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
72
73 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
74
75         * daemon.c, handles.c: rename "sun" local var since it's apparently
76         a #define on Solaris.
77
78 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
79
80         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
81         platforms.
82
83 2002-05-15  Dick Porter  <dick@ximian.com>
84
85         * wait.c: Fix a deadlock in WaitForMultipleObjects
86
87 2002-05-14  Dick Porter  <dick@ximian.com>
88
89         * io.c: Fix a cut&paste error, found by
90         Jaroslaw Kowalski <jarek@atm.com.pl>
91
92 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
93
94         * io.c: Nasty typo.
95
96 2002-05-09  Dick Porter  <dick@ximian.com>
97
98         * threads.c: 
99         * semaphores.c: 
100         * processes.c: 
101         * mutexes.c: 
102         * handles-private.h: 
103         * events.c: 
104         * Makefile.am: Remove now-unused file wait-private.h
105
106 2002-05-08  Dick Porter  <dick@ximian.com>
107
108         * shared.c: Better error messages, and report when daemon
109         connection fails rather than blocking forever.  Do some more
110         shared memory sanity checking.
111
112         * handles.c: Better error messages when connecting to shared
113         memory and the handle daemon.  Fall back to non-shared handles if
114         an error occurs.  Set the default back to 'shared handles'.  Fix a
115         crashing bug in scratch space allocation that mangled the block
116         headers.
117
118 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
119
120         * handles.c (shared_init): Disable SHM for now, people have too
121         many problems with this, and the diagnostics are not helping.
122
123 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
124
125         * io.c: CreateFile sets win32 last error.
126
127 2002-05-05  Dick Porter  <dick@ximian.com>
128
129         * wapi-private.h: 
130         * handles-private.h:
131         * io.c: 
132         * io-private.h:
133         * mutexes.c: 
134         * mutex-private.h: 
135         * processes.c: 
136         * process-private.h: 
137         * semaphores.c: 
138         * semaphore-private.h: 
139         * sockets.c: 
140         * socket-private.h: 
141         * events.c: 
142         * event-private.h: Simplify the WapiHandleOps struct: take out all
143         the file-specific entries, leaving just the items that operate on
144         handles themselves.  Split the close operation into shared and
145         private parts: shared close is called by the daemon.
146
147         * handles.c: As above, but also pass handle allocation, ref and
148         unref operations to the daemon.  Populate the handle_ops array at
149         compile time, because the daemon needs to call ops on handles too.
150         Don't bother to track open handle counts any more, the daemon does
151         that.
152         
153         * threads.c: 
154         * thread-private.h: As above, but also make the thread data
155         handle-private.
156
157         * shared.c: Fork a handle daemon if the calling process created
158         the shared memory segment.
159
160         * daemon.c:
161         * daemon-messages.c:
162         * daemon-messages.h:
163         * Makefile.am: Build a daemon to manage handle allocation and
164         destruction without needing to lock the shared memory
165
166 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
167
168         * atomic.c: Changed to use a normal mutex rather than a spinlock
169         since a lot of platforms seem to not have them :\
170
171 2002-04-30  Dick Porter  <dick@ximian.com>
172
173         * Completely rewrote the handle waiting code: removed the helper
174         thread and its attendant complexity.  All handle waiting is now
175         abstracted into the WaitForSingleObject() and
176         WaitForMultipleObjects() functions.
177
178         * Implemented inter-process sharing of handles using sysv shared
179         memory.  This makes handles even more opaque, with a handle now
180         just an index into an array.
181         
182 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
183
184         * io.c: unitialized pointer in GetCurrentDirectory.
185
186 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
187
188         * threads.c: destroy the mutex at thread destruction
189         (if/when thread destruction code will be actually called).
190         When protecting a tls data pointer from the gc, use also the 
191         thread id in the key.
192         
193 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
194
195         * timed-thread.c: avoid race condition when setting the thread to
196         detached.
197
198 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
199
200         * jit.h: to more #include lines to avoid breaking compilation
201         under windows when upgrading mingw and w32api to version
202         1.3 (thanks Dick!).
203
204 2002-04-16  Dick Porter  <dick@ximian.com>
205
206         * atomic.h: Explanatory comment about lack of 80386 support
207
208 2002-04-15  Dick Porter  <dick@ximian.com>
209
210         * atomic.h: use xaddl for InterlockedIncrement() and
211         InterlockedDecrement().  Use cmpxchgl in a loop for
212         InterlockedExchange() and InterlockedExchangePointer().
213
214 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
215
216         * unicode.c: fix unicode_len() to not access uninitialized memory
217         (and updated to conform to mono code style).
218
219 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
220
221         * io.c: EEXISTS is ignored for directory creation.
222         * mono-mutex.h: remove silly "pragma }" that emacs users insert
223         because they use a broken editor:-)
224
225 2002-03-28  Dick Porter  <dick@ximian.com>
226
227         * sockets.h: 
228         * sockets.c: 
229         * io.c: 
230         * handles.h: 
231         * handles.c: Warning cleanups
232
233 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
234
235         * unicode.h, unicode.c: changed to gunichar2
236         * io.h, io.c: changed strings to gunichar2*, added
237         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
238         some fixes to FindFirstFile() and friends.
239
240 2002-03-26  Dick Porter  <dick@ximian.com>
241
242         * types.h: Implement the large integer struct
243
244         * timefuncs.h:
245         * timefuncs.c: Dummy functions that don't yet implement
246         QueryPerformanceCounter() and QueryPerformanceFrequency()
247
248         * threads.h:
249         * threads.c: Implement SleepEx()
250
251         * system.h:
252         * system.c: Beginnings of GetSystemInfo()
253
254         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
255         thinko
256
257         * context.h:
258         * context.c: Dummy function that doesnt yet implement
259         GetThreadContext()
260
261         * atomic.h: 
262         * atomic.c: Interlocked functions
263
264 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
265
266         * threads.c: use a gc-safe hash table to store tls pointers.
267
268 2002-03-22  Dick Porter  <dick@ximian.com>
269
270         * threads.c: Fix a race condition where a thread can start and
271         exit before the handle has been properly initialised (no reason
272         why the handle couldn't be initialised beforehand, so do so)
273
274         Fix a ms to ns conversion magnitude thinko.
275
276 2002-03-21  Dick Porter  <dick@ximian.com>
277
278         * semaphores.c: Fix a problem when waiting for one or more
279         semaphores, and another semaphore is Released (all waiting
280         semaphores assumed they were signalled)
281
282 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
283
284         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
285         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
286
287 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
288
289         * threads.c (Sleep): bug fix: 1ms == 1000000ns
290
291 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
292
293         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
294         threads.c, io.c: added flush method to handles.
295
296         * io.c: FlushFileBuffers() and FindFirstFile() functions.
297
298 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
299
300         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
301
302 2002-02-20  Dick Porter  <dick@ximian.com>
303
304         * io-layer.h: Always build without cygwin support on windows
305
306 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
307
308         * sockets.c: #undef DEBUG.
309
310 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
311
312         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
313         for FIONBIO, FIONREAD, and SIOCATMARK.
314
315 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
316
317         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
318         for FIONBIO, FIONREAD, and SIOCATMARK.
319
320 2002-02-13  Dick Porter  <dick@ximian.com>
321
322         * sockets.c: Implement shutdown and select
323
324 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
325
326         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
327         functions that take pthread_mutex_t and/or pthread_mutexattr_t
328         arguments for the sake of portability. Implements recursive
329         mutexes and pthread_mutex_timedlock.
330
331         * critical-sections.c:
332         * events.c:
333         * handles.c:
334         * mutexes.c:
335         * semaphores.c:
336         * threads.c:
337         * timed-thread.c:
338         * wait.c: Use the mono-mutex wrapper portability functions/macros.
339
340         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
341
342 2002-01-23  Dick Porter  <dick@ximian.com>
343
344         * sockets.c: Networking support, mostly wrapping BSD socket APIs
345         with handle code, and translating errno into w32 error codes.
346
347         * macros.h: Some w32 macros used with the socket support
348
349         * error.c: Implemented GetLastError() and SetLastError()
350
351         * Makefile.am: Added sockets, with kludge to override some symbols
352
353 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
354
355         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
356         passing them to iconv
357         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
358         from previous commit.
359
360 2001-12-11  Dick Porter  <dick@ximian.com>
361
362         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
363         FileTimeToSystemTime().
364
365         * unicode.c (unicode_len): Nasty way of finding length of unicode
366         string with embedded NULLs (counts until two NULLs together).
367
368         * mutexes.c (mutex_close): 
369         * events.c (event_close): Release the internal pthreads resources
370
371 2001-11-26  Dick Porter  <dick@ximian.com>
372
373         * critical-sections.c:
374         * events.c:
375         * handles.c:
376         * io.c:
377         * mutexes.c:
378         * semaphores.c:
379         * threads.c:
380         * timed-thread.c:
381         * wait.c: turn off DEBUG messages
382
383 2001-11-22  Dick Porter  <dick@ximian.com>
384
385         * handles.c (SignalObjectAndWait): Implement
386
387         * wait.c (WaitForSingleObject): Fix case where timeout == 0
388
389         * threads.c:
390         * semaphores.c:
391         * mutexes.c:
392         * io.c:
393         * events.c: Support for SignalObjectAndWait
394         
395 2001-11-21  Dick Porter  <dick@ximian.com>
396
397         * events.c:
398         * handles.c:
399         * mutexes.c:
400         * semaphores.c:
401         * threads.c:
402         * wait.c: Reliable method of returning which handle was signalled
403         on return from WaitForMultipleObjects().
404
405 2001-11-21  Dick Porter  <dick@ximian.com>
406
407         * events.c: Implement events
408
409 2001-11-15  Dick Porter  <dick@ximian.com>
410
411         * mutexes.c: Implement mutexes
412
413         * threads.c: 
414         * semaphores.c: 
415         * misc.c: Factor out some common code
416
417 2001-11-13  Dick Porter  <dick@ximian.com>
418
419         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
420         GetCurrentThread() by maintaining a hash of thread handles.
421
422         * threads.h: Define thread and process creation flags
423
424 2001-11-12  Dick Porter  <dick@ximian.com>
425
426         * critical-sections.c: Implement critical sections
427
428 2001-11-12  Dick Porter  <dick@ximian.com>
429
430         * semaphores.c: Implement semaphores
431
432         * wait.c (wait_for_item): Maintain a wait count rather than count
433         signalled booleans.
434
435         * threads.c (thread_wait_multiple): Don't lock the wait item, that
436         will block other wait threads
437
438 2001-11-11  Dick Porter  <dick@ximian.com>
439
440         * Makefile.am: Rename some automake variables
441         (from Nick Drochak <ndrochak@gol.com>)
442
443 2001-11-10  Dick Porter  <dick@ximian.com>
444
445         * Makefile.am (libwapiincludedir): Fix include destination
446
447         * .cvsignore: Ignore generated files
448
449 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
450
451         * pthread-compat.c: added some include files to make it compile on
452         linux.
453
454 2001-11-08  Dick Porter  <dick@ximian.com>
455
456         * Initial checkin.
457
458         This is a library emulating the win32 threading and IO API.
459
460