summaryrefslogtreecommitdiff
path: root/amiga/schedule.h
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2014-11-22 16:30:43 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2014-11-22 16:30:43 +0000
commit186e1f4ee32c518a599038e15e4b209864478db7 (patch)
tree2ad599d6f20e8280036b6d464d070fdeb1359071 /amiga/schedule.h
parentfe567952057e820b040371be639842fcb2317bf2 (diff)
parent2de1553a002aff7fa89bb466cdba1b3414413901 (diff)
downloadnetsurf-186e1f4ee32c518a599038e15e4b209864478db7.tar.gz
netsurf-186e1f4ee32c518a599038e15e4b209864478db7.tar.bz2
New asynchronous scheduler
This ensures that if other processes other than the main NetSurf process try to create scheduled tasks, they are always run on the main process.
Diffstat (limited to 'amiga/schedule.h')
-rwxr-xr-xamiga/schedule.h30
1 files changed, 10 insertions, 20 deletions
diff --git a/amiga/schedule.h b/amiga/schedule.h
index 9fcec9a82..cfea4d917 100755
--- a/amiga/schedule.h
+++ b/amiga/schedule.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ * Copyright 2008-2014 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -18,15 +18,8 @@
#ifndef AMIGA_SCHEDULE_H
#define AMIGA_SCHEDULE_H
-#include <proto/timer.h>
#include "amiga/os3support.h"
-struct Device *TimerBase;
-struct TimerIFace *ITimer;
-
-struct TimeRequest *tioreq;
-struct MsgPort *msgport;
-
/**
* Schedule a callback.
*
@@ -41,26 +34,23 @@ struct MsgPort *msgport;
nserror ami_schedule(int t, void (*callback)(void *p), void *p);
/**
- * Initialise amiga scheduler
+ * Handle a message received from the scheduler process.
*
- * /return true if initialised ok or false on error.
+ * \param nsmsgport Message port to process.
*/
-bool ami_schedule_create(void);
+void ami_schedule_handle(struct MsgPort *nsmsgport);
/**
- * Finalise amiga scheduler
+ * Create a new process for the scheduler.
*
+ * \param nsmsgport Message port for the scheduler to send events to.
+ * \return NSERROR_OK on success or error code on failure.
*/
-void ami_schedule_free(void);
+nserror ami_scheduler_process_create(struct MsgPort *nsmsgport);
/**
- * Process events up to current time.
- *
- * This implementation only takes the top entry off the heap, it does not
- * venture to later scheduled events until the next time it is called -
- * immediately afterwards, if we're in a timer signalled loop.
+ * Signal the scheduler process to exit.
*/
-void schedule_run(void);
-
+void ami_scheduler_process_delete(void);
#endif