1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* node.h (struct rb_thread.locals): explicit as struct.

[ruby-core:10585]

* eval.c, node.h (enum rb_thread_status, struct rb_thread,
  rb_curr_thread, rb_main_thread): prefixed.  [ruby-core:10586]

* file.c (chompdirsep): made an unprefixed name static.

* io.c (io_fread): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-03-24 14:40:08 +00:00
parent 2898d5c5a8
commit d33cc535c3
5 changed files with 39 additions and 26 deletions

View file

@ -1,3 +1,15 @@
Sat Mar 24 23:40:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.h (struct rb_thread.locals): explicit as struct.
[ruby-core:10585]
* eval.c, node.h (enum rb_thread_status, struct rb_thread,
rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586]
* file.c (chompdirsep): made an unprefixed name static.
* io.c (io_fread): ditto.
Sat Mar 24 01:54:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (ruby_cleanup): exit by SystemExit and SignalException in END

25
eval.c
View file

@ -243,8 +243,8 @@ static int scope_vmode;
#define SCOPE_SET(f) (scope_vmode=(f))
#define SCOPE_TEST(f) (scope_vmode&(f))
VALUE (*ruby_sandbox_save)(struct thread *) = NULL;
VALUE (*ruby_sandbox_restore)(struct thread *) = NULL;
VALUE (*ruby_sandbox_save)_((rb_thread_t));
VALUE (*ruby_sandbox_restore)_((rb_thread_t));
NODE* ruby_current_node;
int ruby_safe_level = 0;
/* safe-level:
@ -1073,8 +1073,11 @@ NODE *ruby_top_cref;
ruby_scope = _scope; \
scope_vmode = SCOPE_PUBLIC
rb_thread_t curr_thread = 0;
rb_thread_t main_thread;
rb_thread_t rb_curr_thread;
rb_thread_t rb_main_thread;
#define main_thread rb_main_thread
#define curr_thread rb_curr_thread
static void scope_dup _((struct SCOPE *));
#define POP_SCOPE() \
@ -9832,8 +9835,6 @@ extern VALUE rb_last_status;
# endif
#endif
/* typedef struct thread * rb_thread_t; */
#define THREAD_RAISED 0x200 /* temporary flag */
#define THREAD_TERMINATING 0x400 /* persistent flag */
#define THREAD_NO_ENSURE 0x800 /* persistent flag */
@ -9856,7 +9857,7 @@ struct thread_status_t {
int safe;
enum thread_status status;
enum rb_thread_status status;
int wait_for;
int fd;
fd_set readfds;
@ -9958,7 +9959,7 @@ rb_trap_eval(cmd, sig, safe)
static const char *
thread_status_name(status)
enum thread_status status;
enum rb_thread_status status;
{
switch (status) {
case THREAD_RUNNABLE:
@ -11016,7 +11017,7 @@ rb_thread_join(th, limit)
rb_thread_t th;
double limit;
{
enum thread_status last_status = THREAD_RUNNABLE;
enum rb_thread_status last_status = THREAD_RUNNABLE;
if (rb_thread_critical) rb_thread_deadlock();
if (!rb_thread_dead(th)) {
@ -11399,7 +11400,7 @@ rb_thread_pass()
VALUE
rb_thread_stop()
{
enum thread_status last_status = THREAD_RUNNABLE;
enum rb_thread_status last_status = THREAD_RUNNABLE;
rb_thread_critical = 0;
if (curr_thread == curr_thread->next) {
@ -11663,7 +11664,7 @@ rb_thread_group(thread)
#endif
#define THREAD_ALLOC(th) do {\
th = ALLOC(struct thread);\
th = ALLOC(struct rb_thread);\
\
th->next = 0;\
th->prev = 0;\
@ -11828,7 +11829,7 @@ rb_thread_start_0(fn, arg, th)
volatile rb_thread_t th_save = th;
volatile VALUE thread = th->thread;
struct BLOCK *volatile saved_block = 0;
enum thread_status status;
enum rb_thread_status status;
int state;
if (OBJ_FROZEN(curr_thread->thgroup)) {

2
file.c
View file

@ -2433,7 +2433,7 @@ rb_path_last_separator(path)
return last;
}
char *
static char *
chompdirsep(path)
const char *path;
{

2
io.c
View file

@ -1052,7 +1052,7 @@ read_buffered_data(ptr, len, f)
#endif
}
long
static long
io_fread(ptr, len, fptr)
char *ptr;
long len;

24
node.h
View file

@ -338,8 +338,8 @@ extern NODE *ruby_top_cref;
#define NOEX_PUBLIC 0
#define NOEX_NOSUPER 1
#define NOEX_PRIVATE 2
#define NOEX_PROTECTED 4
#define NOEX_MASK 6
#define NOEX_PROTECTED 4
#define NOEX_MASK 6
#define NOEX_UNDEF NOEX_NOSUPER
@ -390,17 +390,17 @@ typedef struct {
typedef jmp_buf rb_jmpbuf_t;
#endif
enum thread_status {
enum rb_thread_status {
THREAD_TO_KILL,
THREAD_RUNNABLE,
THREAD_STOPPED,
THREAD_KILLED,
};
typedef struct thread * rb_thread_t;
typedef struct rb_thread *rb_thread_t;
struct thread {
struct thread *next, *prev;
struct rb_thread {
rb_thread_t next, prev;
rb_jmpbuf_t context;
#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__
unsigned long win32_exception_list;
@ -441,7 +441,7 @@ struct thread {
int safe;
enum thread_status status;
enum rb_thread_status status;
int wait_for;
int fd;
fd_set readfds;
@ -455,17 +455,17 @@ struct thread {
int priority;
VALUE thgroup;
st_table *locals;
struct st_table *locals;
VALUE thread;
VALUE sandbox;
};
extern VALUE (*ruby_sandbox_save)(struct thread *);
extern VALUE (*ruby_sandbox_restore)(struct thread *);
extern rb_thread_t curr_thread;
extern rb_thread_t main_thread;
extern VALUE (*ruby_sandbox_save)_((rb_thread_t));
extern VALUE (*ruby_sandbox_restore)_((rb_thread_t));
extern rb_thread_t rb_curr_thread;
extern rb_thread_t rb_main_thread;
#if defined(__cplusplus)
} /* extern "C" { */