* thread_pthread.c (consume_communication_pipe):
Make "buff" as static. (Maybe) "buff" can be shared between any caller (any threads) because no one use the read values. And remove const value "buff_size", and define CCP_READ_BUFF_SIZE macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2619f216fe
commit
014a5f3178
@ -1,3 +1,11 @@
|
|||||||
|
Tue Jun 28 11:49:14 2011 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* thread_pthread.c (consume_communication_pipe):
|
||||||
|
Make "buff" as static. (Maybe) "buff" can be shared between
|
||||||
|
any caller (any threads) because no one use the read values.
|
||||||
|
And remove const value "buff_size", and define CCP_READ_BUFF_SIZE
|
||||||
|
macro.
|
||||||
|
|
||||||
Tue Jun 28 11:45:30 2011 Eric Hodel <drbrain@segment7.net>
|
Tue Jun 28 11:45:30 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rake: Update rake to fix some bugs and hide deprecated features
|
* lib/rake: Update rake to fix some bugs and hide deprecated features
|
||||||
|
@ -1021,15 +1021,13 @@ rb_thread_wakeup_timer_thread(void)
|
|||||||
static void
|
static void
|
||||||
consume_communication_pipe(void)
|
consume_communication_pipe(void)
|
||||||
{
|
{
|
||||||
const size_t buff_size = 1024;
|
#define CCP_READ_BUFF_SIZE 1024
|
||||||
#ifdef __FreeBSD__
|
/* buffer can be shared because no one refers to them. */
|
||||||
char buff[buff_size];
|
static char buff[CCP_READ_BUFF_SIZE];
|
||||||
#else
|
|
||||||
char buff[1024];
|
|
||||||
#endif
|
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
result = read(timer_thread_pipe[0], buff, buff_size);
|
result = read(timer_thread_pipe[0], buff, CCP_READ_BUFF_SIZE);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EINTR: goto retry;
|
case EINTR: goto retry;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user