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