Skip to content

Commit

Permalink
Thread#priority= should raise SecurityError when $SAFE is 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Feb 29, 2012
1 parent 79a4e82 commit e767a91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,10 @@ rb_thread_priority_set(VALUE thread, SEL sel, VALUE prio)
// FIXME this doesn't really minic what 1.9 does, but do we care?
int policy;
struct sched_param param;
rb_secure(4);
pthread_assert(pthread_getschedparam(GetThreadPtr(thread)->thread,
&policy, &param));

const int max = sched_get_priority_max(policy);
const int min = sched_get_priority_min(policy);

Expand Down

0 comments on commit e767a91

Please sign in to comment.