1 2002-10-01 Dick Porter <dick@ximian.com>
3 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
4 Unfortunately libgc uses the same thread suspend technique that I
5 want to, and the two don't mix: libgc will deadlock when it tries
6 to stop the world if a thread has already been suspended by
7 someone else. Just do the simple suspended create rather than the
8 general purpose thread suspension for now.
10 * threads.c: Pass create flags to the timed_thread create call, to
11 implement suspended thread creation. ResumeThread() partially
12 implemented, to cope with the case where a newly created but
13 suspended thread is launched.
15 2002-09-30 Dick Porter <dick@ximian.com>
17 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
20 2002-09-27 Dick Porter <dick@ximian.com>
22 * semaphores.c: Only include semaphore.h if it's present. Patch
23 for BSD from jmmv@hispabsd.org (Julio Merino).
25 2002-09-27 Dick Porter <dick@ximian.com>
27 * processes.c: Pass environment and working directory to the
28 daemon when forking. Don't let argv[0] be duplicated when looking
29 for the program name. Implement EnumProcessModules (simple
30 version for now, lsof-style later if needed), GetModuleBaseName,
31 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
32 aren't available on Linux).
34 * process-private.h: Store the process name, and the working set
38 * handles-private.h: New functions to store and retrieve an array
39 of strings in the scratch space
41 * daemon.c: Don't miss deleting some handles when a client exits
42 (we used to rely on the client doing the final cleanup, but
43 obviously if the client is no longer there the daemon has to do
46 Process forking now sets the environment and the working
49 * io.c: Don't confuse fd 0 with an unassigned handle struct
51 * atomic.h: Add a google cache alternative to the msdn URL
53 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
56 (_wapi_recvfrom): added ECONNRESET to the switch.
58 2002-09-24 Mark Crichton <crichton@gimp.org>
60 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
63 2002-09-19 Mark Crichton <crichton@gimp.org>
65 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
66 dont have Linux's abstract filesystem for sockets.
68 2002-09-19 Mark Crichton <crichton@gimp.org>
70 * atomic.h: Added SPARC atomic asm code.
71 * daemon.c, handles-private.h, handles.c, wapi-private.h:
72 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
73 Solaris 9, however, the code paths don't seem to work. More testing
74 on the shared case is *really* needed.
76 2002-09-03 Dick Porter <dick@ximian.com>
79 * threads.c: Removed PosixKillThread(), because it's not in the
82 2002-08-20 Dick Porter <dick@ximian.com>
84 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
85 multiples of 4 bytes, to keep header structures aligned. Needed
86 for sparc, at least. (Patch from crichton@gimp.org)
88 * handles.c: Removed 'disable_shm' variable (we've defaulted to
89 building with shm enabled for months now)
91 2002-08-19 Dick Porter <dick@ximian.com>
93 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
94 for legacy NeXT-based systems.
96 2002-08-12 Dick Porter <dick@ximian.com>
98 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
99 from Joseph Wenninger <kde@jowenn.at>)
101 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
103 * threads.c: use fast spinlocks by default
105 2002-08-02 Dick Porter <dick@ximian.com>
107 * io.c (GetStdHandle): Add a handle reference when returning a
108 duplicate console handle. This fixes the unref_handle errors in
111 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
113 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
116 2002-08-01 Dick Porter <dick@ximian.com>
118 * threads.c: Use atomic spinlocks in TLS functions
121 * Makefile.am: Added mono-spinlock.h
123 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
125 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
126 these are needed for sendmsg() and also for struct msghdr (at
127 least on Solaris). Solaris still won't build because struct msghdr
128 doesn't have msg_flags, msg_control, or msg_controllen members.
129 (CMSG_SPACE): Define for systems that don't have it.
132 2002-07-20 Dick Porter <dick@ximian.com>
138 * handles.c: Implemented pipe handles
141 * daemon.c: Fixed bug in handle closing.
144 * daemon.c: Forked processes now close all open file descriptors.
146 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
148 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
151 2002-07-19 Martin Baulig <martin@gnome.org>
153 * threads.c (ExitThread): Call exit() if no threads has been
156 2002-07-17 Dick Porter <dick@ximian.com>
158 * daemon-messages.c: Freebsd fixes from Andreas Kohn
159 <andreas.kohn@gmx.net>
161 2002-07-15 Dick Porter <dick@ximian.com>
163 * io.c: Removed bogus console_flush() method, that was just cut
164 and pasted from file_flush when I separated the two handle types.
166 2002-07-12 Dick Porter <dick@ximian.com>
168 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
169 flags. Fixes bug 27633.
171 2002-07-12 Dick Porter <dick@ximian.com>
175 * daemon.c: Use size of sockaddr_un.sun_path from config.h
177 2002-07-12 Dick Porter <dick@ximian.com>
179 * processes.c (CreateProcess): Send stdin, stdout and stderr
180 handles if the startup info doesnt specify new ones
182 * io.c (GetStdHandle): Return the same handle when the same
183 standard handle is requested
185 * handles.c: Pass file descriptors when forking
187 * daemon.c: Use supplied file descriptors when forking a new
191 * daemon-messages.c: Pass stdin, stdout and stderr file
192 descriptors to the daemon (used when forking)
194 2002-07-11 Miguel de Icaza <miguel@ximian.com>
196 * daemon.c (_wapi_daemon_main): Use sizeof
197 (main_socket_address.sun_path) instead of hardcoded 108 value.
199 * handles.c (shared_init): Use sizeof
200 (shared_socket_address.sun_path) instead of hardcoded 108 value.
202 2002-07-10 Dennis Haney <davh@davh.dk>
206 * daemon.c: Lots of documentation, some added error checking, and
207 code readability improvements.
209 * daemon-messages.h: Add the Error request type to improve error
212 * daemon-messages.c: Do a bit more error checking on send() and
213 recv(), and log errors with a higher severity level.
215 2002-07-04 Dick Porter <dick@ximian.com>
217 * daemon.c (process_process_fork): Fix argument handling, due to
218 buggy understanding of g_strsplit() behaviour.
220 2002-07-03 Dick Porter <dick@ximian.com>
223 * threads.c: Implement OpenThread(). Define access-control values
229 * Makefile.am: Added access.h, to hold shared access-control
232 2002-07-02 Dick Porter <dick@ximian.com>
234 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
236 2002-07-02 Dick Porter <dick@ximian.com>
238 * handles.c (shared_init): Make a second attempt to contact the
239 daemon if the shared memory attach succeeds, but the connect()
240 fails. (This copes with the daemon crashing without cleaning up
246 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
247 the daemon, it's now built into the library.
249 2002-06-25 Dick Porter <dick@ximian.com>
254 * daemon.c: Process forking and handle data management
258 * processes.c: Process forking and other support functions
260 2002-06-25 Dick Porter <dick@ximian.com>
262 * versioninfo.h: PE resource decoding
264 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
265 to be told the string length
267 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
268 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
271 2002-06-12 Dick Porter <dick@ximian.com>
274 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
275 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
276 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
278 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
280 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
281 when writing to a closed socket.
283 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
285 * mono-mutex.c (mono_once): New convenience function for my
290 * critical-sections.c:
298 * atomic.c: Use mono_once() rather than pthread_once().
300 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
302 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
303 if multiple threads all try to call _wapi_handle_new() before the
304 shared data has been initialized, it is possible that we could get
305 into a condition where shared_init() is being executed and later
306 threads will pass by pthread_once() due to the fact that it has
307 already been called and so therefor will attempt to use the shared
308 data before it has been completely initialized. If we instead use
309 a standard mutex locking mechanism around shared_init(), we can
310 avoid the situation entirely. By wrapping the mutex locking in a
311 check to see if we've already initialized the data, we can even
312 avoid wasting resources by having to lock/unlock the mutex in any
313 later calls (the only time we'd have to worry about
314 locking/unlocking is the initial race to call shared_init() at
317 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
319 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
321 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
323 * daemon.c, handles.c: rename "sun" local var since it's apparently
324 a #define on Solaris.
326 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
328 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
331 2002-05-15 Dick Porter <dick@ximian.com>
333 * wait.c: Fix a deadlock in WaitForMultipleObjects
335 2002-05-14 Dick Porter <dick@ximian.com>
337 * io.c: Fix a cut&paste error, found by
338 Jaroslaw Kowalski <jarek@atm.com.pl>
340 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
344 2002-05-09 Dick Porter <dick@ximian.com>
352 * Makefile.am: Remove now-unused file wait-private.h
354 2002-05-08 Dick Porter <dick@ximian.com>
356 * shared.c: Better error messages, and report when daemon
357 connection fails rather than blocking forever. Do some more
358 shared memory sanity checking.
360 * handles.c: Better error messages when connecting to shared
361 memory and the handle daemon. Fall back to non-shared handles if
362 an error occurs. Set the default back to 'shared handles'. Fix a
363 crashing bug in scratch space allocation that mangled the block
366 2002-05-07 Miguel de Icaza <miguel@ximian.com>
368 * handles.c (shared_init): Disable SHM for now, people have too
369 many problems with this, and the diagnostics are not helping.
371 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
373 * io.c: CreateFile sets win32 last error.
375 2002-05-05 Dick Porter <dick@ximian.com>
386 * semaphore-private.h:
390 * event-private.h: Simplify the WapiHandleOps struct: take out all
391 the file-specific entries, leaving just the items that operate on
392 handles themselves. Split the close operation into shared and
393 private parts: shared close is called by the daemon.
395 * handles.c: As above, but also pass handle allocation, ref and
396 unref operations to the daemon. Populate the handle_ops array at
397 compile time, because the daemon needs to call ops on handles too.
398 Don't bother to track open handle counts any more, the daemon does
402 * thread-private.h: As above, but also make the thread data
405 * shared.c: Fork a handle daemon if the calling process created
406 the shared memory segment.
411 * Makefile.am: Build a daemon to manage handle allocation and
412 destruction without needing to lock the shared memory
414 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
416 * atomic.c: Changed to use a normal mutex rather than a spinlock
417 since a lot of platforms seem to not have them :\
419 2002-04-30 Dick Porter <dick@ximian.com>
421 * Completely rewrote the handle waiting code: removed the helper
422 thread and its attendant complexity. All handle waiting is now
423 abstracted into the WaitForSingleObject() and
424 WaitForMultipleObjects() functions.
426 * Implemented inter-process sharing of handles using sysv shared
427 memory. This makes handles even more opaque, with a handle now
428 just an index into an array.
430 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
432 * io.c: unitialized pointer in GetCurrentDirectory.
434 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
436 * threads.c: destroy the mutex at thread destruction
437 (if/when thread destruction code will be actually called).
438 When protecting a tls data pointer from the gc, use also the
439 thread id in the key.
441 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
443 * timed-thread.c: avoid race condition when setting the thread to
446 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
448 * jit.h: to more #include lines to avoid breaking compilation
449 under windows when upgrading mingw and w32api to version
452 2002-04-16 Dick Porter <dick@ximian.com>
454 * atomic.h: Explanatory comment about lack of 80386 support
456 2002-04-15 Dick Porter <dick@ximian.com>
458 * atomic.h: use xaddl for InterlockedIncrement() and
459 InterlockedDecrement(). Use cmpxchgl in a loop for
460 InterlockedExchange() and InterlockedExchangePointer().
462 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
464 * unicode.c: fix unicode_len() to not access uninitialized memory
465 (and updated to conform to mono code style).
467 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
469 * io.c: EEXISTS is ignored for directory creation.
470 * mono-mutex.h: remove silly "pragma }" that emacs users insert
471 because they use a broken editor:-)
473 2002-03-28 Dick Porter <dick@ximian.com>
479 * handles.c: Warning cleanups
481 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
483 * unicode.h, unicode.c: changed to gunichar2
484 * io.h, io.c: changed strings to gunichar2*, added
485 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
486 some fixes to FindFirstFile() and friends.
488 2002-03-26 Dick Porter <dick@ximian.com>
490 * types.h: Implement the large integer struct
493 * timefuncs.c: Dummy functions that don't yet implement
494 QueryPerformanceCounter() and QueryPerformanceFrequency()
497 * threads.c: Implement SleepEx()
500 * system.c: Beginnings of GetSystemInfo()
502 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
506 * context.c: Dummy function that doesnt yet implement
510 * atomic.c: Interlocked functions
512 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
514 * threads.c: use a gc-safe hash table to store tls pointers.
516 2002-03-22 Dick Porter <dick@ximian.com>
518 * threads.c: Fix a race condition where a thread can start and
519 exit before the handle has been properly initialised (no reason
520 why the handle couldn't be initialised beforehand, so do so)
522 Fix a ms to ns conversion magnitude thinko.
524 2002-03-21 Dick Porter <dick@ximian.com>
526 * semaphores.c: Fix a problem when waiting for one or more
527 semaphores, and another semaphore is Released (all waiting
528 semaphores assumed they were signalled)
530 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
532 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
533 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
535 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
537 * threads.c (Sleep): bug fix: 1ms == 1000000ns
539 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
541 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
542 threads.c, io.c: added flush method to handles.
544 * io.c: FlushFileBuffers() and FindFirstFile() functions.
546 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
548 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
550 2002-02-20 Dick Porter <dick@ximian.com>
552 * io-layer.h: Always build without cygwin support on windows
554 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
556 * sockets.c: #undef DEBUG.
558 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
560 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
561 for FIONBIO, FIONREAD, and SIOCATMARK.
563 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
565 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
566 for FIONBIO, FIONREAD, and SIOCATMARK.
568 2002-02-13 Dick Porter <dick@ximian.com>
570 * sockets.c: Implement shutdown and select
572 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
574 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
575 functions that take pthread_mutex_t and/or pthread_mutexattr_t
576 arguments for the sake of portability. Implements recursive
577 mutexes and pthread_mutex_timedlock.
579 * critical-sections.c:
586 * wait.c: Use the mono-mutex wrapper portability functions/macros.
588 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
590 2002-01-23 Dick Porter <dick@ximian.com>
592 * sockets.c: Networking support, mostly wrapping BSD socket APIs
593 with handle code, and translating errno into w32 error codes.
595 * macros.h: Some w32 macros used with the socket support
597 * error.c: Implemented GetLastError() and SetLastError()
599 * Makefile.am: Added sockets, with kludge to override some symbols
601 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
603 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
604 passing them to iconv
605 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
606 from previous commit.
608 2001-12-11 Dick Porter <dick@ximian.com>
610 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
611 FileTimeToSystemTime().
613 * unicode.c (unicode_len): Nasty way of finding length of unicode
614 string with embedded NULLs (counts until two NULLs together).
616 * mutexes.c (mutex_close):
617 * events.c (event_close): Release the internal pthreads resources
619 2001-11-26 Dick Porter <dick@ximian.com>
621 * critical-sections.c:
629 * wait.c: turn off DEBUG messages
631 2001-11-22 Dick Porter <dick@ximian.com>
633 * handles.c (SignalObjectAndWait): Implement
635 * wait.c (WaitForSingleObject): Fix case where timeout == 0
641 * events.c: Support for SignalObjectAndWait
643 2001-11-21 Dick Porter <dick@ximian.com>
650 * wait.c: Reliable method of returning which handle was signalled
651 on return from WaitForMultipleObjects().
653 2001-11-21 Dick Porter <dick@ximian.com>
655 * events.c: Implement events
657 2001-11-15 Dick Porter <dick@ximian.com>
659 * mutexes.c: Implement mutexes
663 * misc.c: Factor out some common code
665 2001-11-13 Dick Porter <dick@ximian.com>
667 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
668 GetCurrentThread() by maintaining a hash of thread handles.
670 * threads.h: Define thread and process creation flags
672 2001-11-12 Dick Porter <dick@ximian.com>
674 * critical-sections.c: Implement critical sections
676 2001-11-12 Dick Porter <dick@ximian.com>
678 * semaphores.c: Implement semaphores
680 * wait.c (wait_for_item): Maintain a wait count rather than count
683 * threads.c (thread_wait_multiple): Don't lock the wait item, that
684 will block other wait threads
686 2001-11-11 Dick Porter <dick@ximian.com>
688 * Makefile.am: Rename some automake variables
689 (from Nick Drochak <ndrochak@gol.com>)
691 2001-11-10 Dick Porter <dick@ximian.com>
693 * Makefile.am (libwapiincludedir): Fix include destination
695 * .cvsignore: Ignore generated files
697 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
699 * pthread-compat.c: added some include files to make it compile on
702 2001-11-08 Dick Porter <dick@ximian.com>
706 This is a library emulating the win32 threading and IO API.