зеркало из https://github.com/github/ruby.git
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
517fd61e14
Коммит
a73ba1def7
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,11 @@
|
||||||
|
Mon Jul 28 21:24:33 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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 <mame@tsg.ne.jp>
|
Mon Jul 28 21:00:10 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/ruby/test_require.rb (test_require_too_long_filename):
|
* test/ruby/test_require.rb (test_require_too_long_filename):
|
||||||
|
@ -34,9 +42,9 @@ Mon Jul 28 16:06:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
Mon Jul 28 16:01:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Jul 28 16:01:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* thread_win32.[ch]: moved definitions of cond_every_entry and
|
* thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): moved
|
||||||
rb_thread_cond_struct from .c to .h because rb_thread_cond_struct
|
the definitions from .c to .h because rb_thread_cond_struct is used
|
||||||
is used in vm_core.h.
|
in vm_core.h.
|
||||||
|
|
||||||
Mon Jul 28 14:29:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jul 28 14:29:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
@ -1913,8 +1921,8 @@ Fri Jun 20 03:26:00 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
Fri Jun 20 03:19:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Fri Jun 20 03:19:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/testunit/collector/test_dir.rb: r15825 made it unnecessary to change
|
* test/testunit/collector/test_dir.rb: r15825 made it unnecessary to
|
||||||
String to Symbol.
|
change String to Symbol.
|
||||||
|
|
||||||
* test/testunit/collector/test_objectspace.rb: ditto.
|
* test/testunit/collector/test_objectspace.rb: ditto.
|
||||||
|
|
||||||
|
|
21
thread.c
21
thread.c
|
@ -62,16 +62,6 @@ static double timeofday(void);
|
||||||
struct timeval rb_time_interval(VALUE);
|
struct timeval rb_time_interval(VALUE);
|
||||||
static int rb_thread_dead(rb_thread_t *th);
|
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);
|
static void rb_check_deadlock(rb_vm_t *vm);
|
||||||
|
|
||||||
void rb_signal_exec(rb_thread_t *th, int sig);
|
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;
|
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
|
void
|
||||||
rb_thread_terminate_all(void)
|
rb_thread_terminate_all(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -333,6 +333,16 @@ native_mutex_destroy(rb_thread_lock_t *lock)
|
||||||
#endif
|
#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
|
static void
|
||||||
native_cond_signal(rb_thread_cond_t *cond)
|
native_cond_signal(rb_thread_cond_t *cond)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,16 +25,6 @@ typedef HANDLE rb_thread_id_t;
|
||||||
typedef CRITICAL_SECTION rb_thread_lock_t;
|
typedef CRITICAL_SECTION rb_thread_lock_t;
|
||||||
typedef struct rb_thread_cond_struct rb_thread_cond_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 {
|
typedef struct native_thread_data_struct {
|
||||||
HANDLE interrupt_event;
|
HANDLE interrupt_event;
|
||||||
} native_thread_data_t;
|
} native_thread_data_t;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче