* thread.cc (pthread::create): Use thread mutex to control synchronization
rather than creating a suspended thread. Wait for "cancellation event" to indicate that started thread has been properly initialized. (pthread::thread_init_wrapper): Use set_tls_self_pointer() to set tid and cygtls. Signal with cancel_event when done.
This commit is contained in:
parent
b96dbd203d
commit
3e78b5d75c
|
@ -1,6 +1,15 @@
|
||||||
|
2004-04-12 Christopher Faylor <cgf@alum.bu.edu>
|
||||||
|
|
||||||
|
* thread.cc (pthread::create): Use thread mutex to control
|
||||||
|
synchronization rather than creating a suspended thread. Wait for
|
||||||
|
"cancellation event" to indicate that started thread has been properly
|
||||||
|
initialized.
|
||||||
|
(pthread::thread_init_wrapper): Use set_tls_self_pointer() to set tid
|
||||||
|
and cygtls. Signal with cancel_event when done.
|
||||||
|
|
||||||
2004-04-12 Pierre Humblet <pierre.humblet@ieee.org>
|
2004-04-12 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* path.cc (path_conv::check): Fix "tail filling" logic.
|
* path.cc (path_conv::check): Fix "tail filling" logic.
|
||||||
|
|
||||||
2004-04-11 Christopher Faylor <cgf@alum.bu.edu>
|
2004-04-11 Christopher Faylor <cgf@alum.bu.edu>
|
||||||
|
|
||||||
|
@ -169,14 +178,14 @@
|
||||||
(FHSTATOFF): Remove.
|
(FHSTATOFF): Remove.
|
||||||
(UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum
|
(UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum
|
||||||
connect_state.
|
connect_state.
|
||||||
(fhandler_base::status): Define as bitfield struct type status_flags.
|
(fhandler_base::status): Define as bitfield struct type status_flags.
|
||||||
Remove unused flags entirely. Accomodate all status access methods.
|
Remove unused flags entirely. Accomodate all status access methods.
|
||||||
(open_status): Define as bitfield struct type status_flags.
|
(open_status): Define as bitfield struct type status_flags.
|
||||||
(fhandler_socket): Move socket related status bits to here. Redefine
|
(fhandler_socket): Move socket related status bits to here. Redefine
|
||||||
had_connect_or_listen to be part of these status bits. Accomodate
|
had_connect_or_listen to be part of these status bits. Accomodate
|
||||||
related access methods.
|
related access methods.
|
||||||
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink
|
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink
|
||||||
instead of dropped method get_symlink_p.
|
instead of dropped method get_symlink_p.
|
||||||
(fhandler_base::open_fs): Remove setting dropped status flags.
|
(fhandler_base::open_fs): Remove setting dropped status flags.
|
||||||
* fhandler_socket.cc: Use values from enum connect_state throughout.
|
* fhandler_socket.cc: Use values from enum connect_state throughout.
|
||||||
(fhandler_socket::fhandler_socket): Initialize status bits.
|
(fhandler_socket::fhandler_socket): Initialize status bits.
|
||||||
|
@ -352,7 +361,7 @@
|
||||||
* shm.cc (shmat): If shmid is unknown, call a special variation
|
* shm.cc (shmat): If shmid is unknown, call a special variation
|
||||||
of shmget to retrieve the shared memory segment from Cygserver
|
of shmget to retrieve the shared memory segment from Cygserver
|
||||||
instead of failing immediately.
|
instead of failing immediately.
|
||||||
* include/cygwin/ipc.h (IPC_KEY_IS_SHMID): New internal flag for
|
* include/cygwin/ipc.h (IPC_KEY_IS_SHMID): New internal flag for
|
||||||
shmget when called from shmat.
|
shmget when called from shmat.
|
||||||
|
|
||||||
2004-03-29 Corinna Vinschen <corinna@vinschen.de>
|
2004-03-29 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
@ -509,7 +518,7 @@
|
||||||
* autoload.cc: Load eight more functions for waveIn support.
|
* autoload.cc: Load eight more functions for waveIn support.
|
||||||
* fhandler.h (class fhandler_dev_dsp): Add class Audio, class Audio_in
|
* fhandler.h (class fhandler_dev_dsp): Add class Audio, class Audio_in
|
||||||
and class Audio_out members and audio_in_, audio_out_ pointers so
|
and class Audio_out members and audio_in_, audio_out_ pointers so
|
||||||
that future changes are restricted to file fhandler_dsp.cc.
|
that future changes are restricted to file fhandler_dsp.cc.
|
||||||
* fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add this class to treat
|
* fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add this class to treat
|
||||||
things common to audio recording and playback.
|
things common to audio recording and playback.
|
||||||
Add more format conversions.
|
Add more format conversions.
|
||||||
|
@ -571,8 +580,8 @@
|
||||||
|
|
||||||
2004-03-19 Pierre Humblet <pierre.humblet@ieee.org>
|
2004-03-19 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* dir.cc (rmdir): Reorganize error handling to reduce indentation.
|
* dir.cc (rmdir): Reorganize error handling to reduce indentation.
|
||||||
|
|
||||||
2004-03-19 Christopher Faylor <cgf@redhat.com>
|
2004-03-19 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* include/cygwin/version.h: Bump DLL minor number to 10.
|
* include/cygwin/version.h: Bump DLL minor number to 10.
|
||||||
|
@ -714,7 +723,7 @@
|
||||||
(fhandler_dev_tape::read_file): Ditto.
|
(fhandler_dev_tape::read_file): Ditto.
|
||||||
(fhandler_dev_tape::tape_get_feature): Convert to inline method.
|
(fhandler_dev_tape::tape_get_feature): Convert to inline method.
|
||||||
(fhandler_dev_tape::tape_error): New method, created from former
|
(fhandler_dev_tape::tape_error): New method, created from former
|
||||||
static function.
|
static function.
|
||||||
(fhandler_dev_tape::tape_get_blocksize): Remove declaration.
|
(fhandler_dev_tape::tape_get_blocksize): Remove declaration.
|
||||||
* fhandler_raw.cc (fhandler_dev_raw::write_file): New method, created
|
* fhandler_raw.cc (fhandler_dev_raw::write_file): New method, created
|
||||||
from former static function.
|
from former static function.
|
||||||
|
|
|
@ -290,9 +290,9 @@ pthread::create (void *(*func) (void *), pthread_attr *newattr,
|
||||||
function = func;
|
function = func;
|
||||||
arg = threadarg;
|
arg = threadarg;
|
||||||
|
|
||||||
|
mutex.lock ();
|
||||||
win32_obj_id = ::CreateThread (&sec_none_nih, attr.stacksize,
|
win32_obj_id = ::CreateThread (&sec_none_nih, attr.stacksize,
|
||||||
thread_init_wrapper, this, CREATE_SUSPENDED,
|
thread_init_wrapper, this, 0, &thread_id);
|
||||||
&thread_id);
|
|
||||||
|
|
||||||
if (!win32_obj_id)
|
if (!win32_obj_id)
|
||||||
{
|
{
|
||||||
|
@ -301,9 +301,12 @@ pthread::create (void *(*func) (void *), pthread_attr *newattr,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (WaitForSingleObject (cancel_event, 5000) != WAIT_OBJECT_0)
|
||||||
|
thread_printf ("event never arrived after CreateThread");
|
||||||
|
ResetEvent (cancel_event);
|
||||||
postcreate ();
|
postcreate ();
|
||||||
ResumeThread (win32_obj_id);
|
|
||||||
}
|
}
|
||||||
|
mutex.unlock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1861,7 +1864,8 @@ DWORD WINAPI
|
||||||
pthread::thread_init_wrapper (void *arg)
|
pthread::thread_init_wrapper (void *arg)
|
||||||
{
|
{
|
||||||
pthread *thread = (pthread *) arg;
|
pthread *thread = (pthread *) arg;
|
||||||
_my_tls.tid = thread;
|
set_tls_self_pointer (thread);
|
||||||
|
SetEvent (thread->cancel_event);
|
||||||
|
|
||||||
thread->mutex.lock ();
|
thread->mutex.lock ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue