* thread_pthread.c (register_cached_thread_and_wait):
return immediately if malloc() failed. [ruby-core:43960] [ruby-trunk - Bug #6235] * thread_pthread.c (USE_THREAD_CACHE): check already defined or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5605afa5e2
commit
91aba07aff
@ -1,3 +1,11 @@
|
|||||||
|
Tue Jun 26 16:57:14 2012 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* thread_pthread.c (register_cached_thread_and_wait):
|
||||||
|
return immediately if malloc() failed.
|
||||||
|
[ruby-core:43960] [ruby-trunk - Bug #6235]
|
||||||
|
|
||||||
|
* thread_pthread.c (USE_THREAD_CACHE): check already defined or not.
|
||||||
|
|
||||||
Tue Jun 26 10:01:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Jun 26 10:01:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_s_popen): revert r36213 "popen: shell commands with
|
* io.c (rb_io_s_popen): revert r36213 "popen: shell commands with
|
||||||
|
@ -480,7 +480,9 @@ native_thread_destroy(rb_thread_t *th)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USE_THREAD_CACHE
|
||||||
#define USE_THREAD_CACHE 0
|
#define USE_THREAD_CACHE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if USE_THREAD_CACHE
|
#if USE_THREAD_CACHE
|
||||||
static rb_thread_t *register_cached_thread_and_wait(void);
|
static rb_thread_t *register_cached_thread_and_wait(void);
|
||||||
@ -717,11 +719,15 @@ register_cached_thread_and_wait(void)
|
|||||||
{
|
{
|
||||||
rb_thread_cond_t cond = { PTHREAD_COND_INITIALIZER, };
|
rb_thread_cond_t cond = { PTHREAD_COND_INITIALIZER, };
|
||||||
volatile rb_thread_t *th_area = 0;
|
volatile rb_thread_t *th_area = 0;
|
||||||
|
struct timeval tv;
|
||||||
|
struct timespec ts;
|
||||||
struct cached_thread_entry *entry =
|
struct cached_thread_entry *entry =
|
||||||
(struct cached_thread_entry *)malloc(sizeof(struct cached_thread_entry));
|
(struct cached_thread_entry *)malloc(sizeof(struct cached_thread_entry));
|
||||||
|
|
||||||
struct timeval tv;
|
if (entry == 0) {
|
||||||
struct timespec ts;
|
return 0; /* failed -> terminate thread immediately */
|
||||||
|
}
|
||||||
|
|
||||||
gettimeofday(&tv, 0);
|
gettimeofday(&tv, 0);
|
||||||
ts.tv_sec = tv.tv_sec + 60;
|
ts.tv_sec = tv.tv_sec + 60;
|
||||||
ts.tv_nsec = tv.tv_usec * 1000;
|
ts.tv_nsec = tv.tv_usec * 1000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user