* thread.c (blocking_region_begin): define before BLOCKING_REGION.
reported by Luis Lavena. [ruby-core:26670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
145f07fac2
commit
6ebdf24500
@ -1,3 +1,8 @@
|
|||||||
|
Wed Nov 11 08:32:45 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* thread.c (blocking_region_begin): define before BLOCKING_REGION.
|
||||||
|
reported by Luis Lavena. [ruby-core:26670]
|
||||||
|
|
||||||
Wed Nov 11 08:22:19 2009 Tanaka Akira <akr@fsij.org>
|
Wed Nov 11 08:22:19 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* util.c (ruby_strtod): use dval() consistently.
|
* util.c (ruby_strtod): use dval() consistently.
|
||||||
|
21
thread.c
21
thread.c
@ -122,6 +122,17 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio
|
|||||||
GVL_UNLOCK_END(); \
|
GVL_UNLOCK_END(); \
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
#define blocking_region_begin(th, region, func, arg) \
|
||||||
|
do { \
|
||||||
|
(region)->prev_status = (th)->status; \
|
||||||
|
(th)->blocking_region_buffer = (region); \
|
||||||
|
set_unblock_function((th), (func), (arg), &(region)->oldubf); \
|
||||||
|
(th)->status = THREAD_STOPPED; \
|
||||||
|
thread_debug("enter blocking region (%p)\n", (void *)(th)); \
|
||||||
|
RB_GC_SAVE_MACHINE_CONTEXT(th); \
|
||||||
|
native_mutex_unlock(&(th)->vm->global_vm_lock); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define BLOCKING_REGION(exec, ubf, ubfarg) do { \
|
#define BLOCKING_REGION(exec, ubf, ubfarg) do { \
|
||||||
rb_thread_t *__th = GET_THREAD(); \
|
rb_thread_t *__th = GET_THREAD(); \
|
||||||
struct rb_blocking_region_buffer __region; \
|
struct rb_blocking_region_buffer __region; \
|
||||||
@ -987,16 +998,6 @@ rb_thread_schedule(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* blocking region */
|
/* blocking region */
|
||||||
#define blocking_region_begin(th, region, func, arg) \
|
|
||||||
do { \
|
|
||||||
(region)->prev_status = (th)->status; \
|
|
||||||
(th)->blocking_region_buffer = (region); \
|
|
||||||
set_unblock_function((th), (func), (arg), &(region)->oldubf); \
|
|
||||||
(th)->status = THREAD_STOPPED; \
|
|
||||||
thread_debug("enter blocking region (%p)\n", (void *)(th)); \
|
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th); \
|
|
||||||
native_mutex_unlock(&(th)->vm->global_vm_lock); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region)
|
blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user