mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-17 15:04:18 +03:00
Disabled the new scheduler by default as it is more unstable than I thought :(
Defining AMI_SCHEDULER_USES_TIMER will enable it again. svn path=/trunk/netsurf/; revision=5291
This commit is contained in:
parent
c6ac553d3d
commit
f78ed94926
@ -609,6 +609,9 @@ void ami_handle_msg(void)
|
||||
break;
|
||||
|
||||
case WMHI_INTUITICK:
|
||||
#ifndef AMI_SCHEDULER_USES_TIMER
|
||||
schedule_run();
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -39,8 +39,15 @@ void schedule(int t, void (*callback)(void *p), void *p)
|
||||
struct timeval tv;
|
||||
|
||||
obj = AddObject(schedule_list,AMINS_CALLBACK);
|
||||
if(!obj) return;
|
||||
|
||||
obj->objstruct_size = sizeof(struct nscallback);
|
||||
obj->objstruct = AllocVec(obj->objstruct_size,MEMF_CLEAR);
|
||||
if(!obj->objstruct)
|
||||
{
|
||||
DelObject(obj);
|
||||
return;
|
||||
}
|
||||
|
||||
nscb = (struct nscallback *)obj->objstruct;
|
||||
|
||||
@ -55,15 +62,16 @@ void schedule(int t, void (*callback)(void *p), void *p)
|
||||
|
||||
GetSysTime(&tv);
|
||||
AddTime(&nscb->tv,&tv); // now contains time when event occurs
|
||||
|
||||
nscb->treq = AllocVec(sizeof(struct timerequest),MEMF_CLEAR);
|
||||
|
||||
*nscb->treq = *tioreq;
|
||||
nscb->treq->tr_node.io_Command=TR_ADDREQUEST;
|
||||
nscb->treq->tr_time.tv_sec=nscb->tv.tv_sec; // secs
|
||||
nscb->treq->tr_time.tv_micro=nscb->tv.tv_micro; // micro
|
||||
SendIO((struct IORequest *)nscb->treq);
|
||||
|
||||
#ifdef AMI_SCHEDULER_USES_TIMER
|
||||
if(nscb->treq = AllocVec(sizeof(struct timerequest),MEMF_CLEAR))
|
||||
{
|
||||
*nscb->treq = *tioreq;
|
||||
nscb->treq->tr_node.io_Command=TR_ADDREQUEST;
|
||||
nscb->treq->tr_time.tv_sec=nscb->tv.tv_sec; // secs
|
||||
nscb->treq->tr_time.tv_micro=nscb->tv.tv_micro; // micro
|
||||
SendIO((struct IORequest *)nscb->treq);
|
||||
}
|
||||
#endif
|
||||
nscb->callback = callback;
|
||||
nscb->p = p;
|
||||
}
|
||||
@ -147,7 +155,7 @@ void ami_remove_timer_event(struct nscallback *nscb)
|
||||
|
||||
if(nscb->treq)
|
||||
{
|
||||
if(CheckIO((struct IORequest *)nscb->treq)==0)
|
||||
if(CheckIO((struct IORequest *)nscb->treq)==NULL)
|
||||
AbortIO((struct IORequest *)nscb->treq);
|
||||
|
||||
WaitIO((struct IORequest *)nscb->treq);
|
||||
|
Loading…
x
Reference in New Issue
Block a user