diff --git a/ChangeLog b/ChangeLog index b0827d6cb7..100a6734fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Jul 28 21:24:33 2008 NAKAMURA Usaku + + * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): reverted + r18239 because r18245 made the changes unnecessary. + + * thread.c (rb_mutex_struct): define after including thread_{pthread, + win32}.c. + Mon Jul 28 21:00:10 2008 Yusuke Endoh * test/ruby/test_require.rb (test_require_too_long_filename): @@ -34,9 +42,9 @@ Mon Jul 28 16:06:36 2008 NAKAMURA Usaku Mon Jul 28 16:01:12 2008 NAKAMURA Usaku - * thread_win32.[ch]: moved definitions of cond_every_entry and - rb_thread_cond_struct from .c to .h because rb_thread_cond_struct - is used in vm_core.h. + * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): moved + the definitions from .c to .h because rb_thread_cond_struct is used + in vm_core.h. Mon Jul 28 14:29:54 2008 Nobuyoshi Nakada @@ -1913,8 +1921,8 @@ Fri Jun 20 03:26:00 2008 NAKAMURA Usaku Fri Jun 20 03:19:39 2008 Yusuke Endoh - * test/testunit/collector/test_dir.rb: r15825 made it unnecessary to change - String to Symbol. + * test/testunit/collector/test_dir.rb: r15825 made it unnecessary to + change String to Symbol. * test/testunit/collector/test_objectspace.rb: ditto. diff --git a/thread.c b/thread.c index c27595a21a..c25e8b1f65 100644 --- a/thread.c +++ b/thread.c @@ -62,16 +62,6 @@ static double timeofday(void); struct timeval rb_time_interval(VALUE); static int rb_thread_dead(rb_thread_t *th); -typedef struct rb_mutex_struct -{ - rb_thread_lock_t lock; - rb_thread_cond_t cond; - struct rb_thread_struct volatile *th; - volatile int cond_waiting, cond_notified; - struct rb_mutex_struct *next_mutex; -} mutex_t; - -static void rb_mutex_unlock_all(mutex_t *mutex); static void rb_check_deadlock(rb_vm_t *vm); void rb_signal_exec(rb_thread_t *th, int sig); @@ -284,6 +274,17 @@ terminate_i(st_data_t key, st_data_t val, rb_thread_t *main_thread) return ST_CONTINUE; } +typedef struct rb_mutex_struct +{ + rb_thread_lock_t lock; + rb_thread_cond_t cond; + struct rb_thread_struct volatile *th; + volatile int cond_waiting, cond_notified; + struct rb_mutex_struct *next_mutex; +} mutex_t; + +static void rb_mutex_unlock_all(mutex_t *mutex); + void rb_thread_terminate_all(void) { diff --git a/thread_win32.c b/thread_win32.c index 3654663cc6..9241d274b0 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -333,6 +333,16 @@ native_mutex_destroy(rb_thread_lock_t *lock) #endif } +struct cond_event_entry { + struct cond_event_entry* next; + HANDLE event; +}; + +struct rb_thread_cond_struct { + struct cond_event_entry *next; + struct cond_event_entry *last; +}; + static void native_cond_signal(rb_thread_cond_t *cond) { diff --git a/thread_win32.h b/thread_win32.h index cc982a9afc..ec2930df12 100644 --- a/thread_win32.h +++ b/thread_win32.h @@ -25,16 +25,6 @@ typedef HANDLE rb_thread_id_t; typedef CRITICAL_SECTION rb_thread_lock_t; typedef struct rb_thread_cond_struct rb_thread_cond_t; -struct cond_event_entry { - struct cond_event_entry* next; - HANDLE event; -}; - -struct rb_thread_cond_struct { - struct cond_event_entry *next; - struct cond_event_entry *last; -}; - typedef struct native_thread_data_struct { HANDLE interrupt_event; } native_thread_data_t;