Skip to content

Commit

Permalink
* thread.c: rename functions which require a parameter
Browse files Browse the repository at this point in the history
  "rb_thread_t *", the prefix to be rb_threadptr_ instead of
  rb_thread_.
* thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook):
  change the parameter type from rb_thread_t * to VALUE.
* eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c:
  ditto.
* include/ruby/intern.h: remove decl of rb_thread_signal_raise() and
  rb_thread_signal_exit().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Jun 8, 2009
1 parent 33a8def commit 79b62da
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 52 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Tue Jun 9 01:07:33 2009 Koichi Sasada <ko1@atdot.net>

* thread.c: rename functions which require a parameter
"rb_thread_t *", the prefix to be rb_threadptr_ instead of
rb_thread_.

* thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook):
change the parameter type from rb_thread_t * to VALUE.

* eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c:
ditto.

* include/ruby/intern.h: remove decl of rb_thread_signal_raise() and
rb_thread_signal_exit().

Mon Jun 8 05:07:41 2009 Koichi Sasada <ko1@atdot.net>

* thread_pthread.c (rb_thread_create_timer_thread): print fatal error
Expand Down
4 changes: 2 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ rb_longjmp(int tag, volatile VALUE mesg)
const char *file;
volatile int line = 0;

if (rb_thread_set_raised(th)) {
if (rb_threadptr_set_raised(th)) {
th->errinfo = exception_error;
JUMP_TAG(TAG_FATAL);
}
Expand Down Expand Up @@ -391,7 +391,7 @@ rb_longjmp(int tag, volatile VALUE mesg)
th->errinfo = mesg;
}
else if (status) {
rb_thread_reset_raised(th);
rb_threadptr_reset_raised(th);
JUMP_TAG(status);
}
}
Expand Down
4 changes: 2 additions & 2 deletions eval_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ error_handle(int ex)
int status = EXIT_FAILURE;
rb_thread_t *th = GET_THREAD();

if (rb_thread_set_raised(th))
if (rb_threadptr_set_raised(th))
return EXIT_FAILURE;
switch (ex & TAG_MASK) {
case 0:
Expand Down Expand Up @@ -267,6 +267,6 @@ error_handle(int ex)
rb_bug("Unknown longjmp status %d", ex);
break;
}
rb_thread_reset_raised(th);
rb_threadptr_reset_raised(th);
return status;
}
4 changes: 2 additions & 2 deletions eval_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ enum {
RAISED_STACKOVERFLOW = 2,
RAISED_NOMEMORY = 4
};
int rb_thread_set_raised(rb_thread_t *th);
int rb_thread_reset_raised(rb_thread_t *th);
int rb_threadptr_set_raised(rb_thread_t *th);
int rb_threadptr_reset_raised(rb_thread_t *th);
#define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f))
#define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f))
#define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0)
Expand Down
2 changes: 0 additions & 2 deletions include/ruby/intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ VALUE rb_thread_wakeup(VALUE);
VALUE rb_thread_run(VALUE);
VALUE rb_thread_kill(VALUE);
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
void rb_thread_signal_raise(void *, int);
void rb_thread_signal_exit(void *);
int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
void rb_thread_wait_for(struct timeval);
Expand Down
4 changes: 2 additions & 2 deletions signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,12 @@ rb_signal_exec(rb_thread_t *th, int sig)
#ifdef SIGUSR2
case SIGUSR2:
#endif
rb_thread_signal_raise(th, sig);
rb_threadptr_signal_raise(th, sig);
break;
}
}
else if (cmd == Qundef) {
rb_thread_signal_exit(th);
rb_threadptr_signal_exit(th);
}
else {
signal_exec(cmd, safe, sig);
Expand Down
Loading

0 comments on commit 79b62da

Please sign in to comment.