--- IO-AIO/AIO.xs 2006/10/24 03:17:39 1.67 +++ IO-AIO/AIO.xs 2006/10/24 15:15:56 1.70 @@ -1,3 +1,6 @@ +/* solaris */ +#define _POSIX_PTHREAD_SEMANTICS 1 + #if __linux # define _GNU_SOURCE #endif @@ -75,7 +78,7 @@ REQ_READDIR, REQ_LINK, REQ_SYMLINK, REQ_GROUP, REQ_NOP, - REQ_SLEEP, + REQ_BUSY, }; #define AIO_REQ_KLASS "IO::AIO::REQ" @@ -363,7 +366,7 @@ break; case REQ_NOP: - case REQ_SLEEP: + case REQ_BUSY: break; default: @@ -907,7 +910,7 @@ case REQ_FSYNC: req->result = fsync (req->fd); break; case REQ_READDIR: req->result = scandir_ (req->dataptr, &req->data2ptr); break; - case REQ_SLEEP: + case REQ_BUSY: { struct timeval tv; @@ -1264,14 +1267,14 @@ } void -aio_sleep (delay,callback=&PL_sv_undef) +aio_busy (delay,callback=&PL_sv_undef) double delay SV * callback PPCODE: { dREQ; - req->type = REQ_SLEEP; + req->type = REQ_BUSY; req->fd = delay < 0. ? 0 : delay; req->fd2 = delay < 0. ? 0 : 1000. * (delay - req->fd); @@ -1306,10 +1309,18 @@ void aioreq_pri (int pri = DEFAULT_PRI) - CODE: - if (pri < PRI_MIN) pri = PRI_MIN; - if (pri > PRI_MAX) pri = PRI_MAX; - next_pri = pri + PRI_BIAS; + CODE: + if (pri < PRI_MIN) pri = PRI_MIN; + if (pri > PRI_MAX) pri = PRI_MAX; + next_pri = pri + PRI_BIAS; + +void +aioreq_nice (int nice = 0) + CODE: + nice = next_pri - nice; + if (nice < PRI_MIN) nice = PRI_MIN; + if (nice > PRI_MAX) nice = PRI_MAX; + next_pri = nice + PRI_BIAS; void flush ()