typedef struct workqueue_entry_s workqueue_entry_t;
/** Possible return value from a work function: */
-typedef enum {
+typedef enum workqueue_reply_t {
WQ_RPL_REPLY = 0, /** indicates success */
WQ_RPL_ERROR = 1, /** indicates fatal error */
WQ_RPL_SHUTDOWN = 2, /** indicates thread is shutting down */
}
}
+/** DOCDOC */
+workqueue_entry_t *
+cpuworker_queue_work(workqueue_reply_t (*fn)(void *, void *),
+ void (*reply_fn)(void *),
+ void *arg)
+{
+ tor_assert(threadpool);
+
+ return threadpool_queue_work(threadpool,
+ fn,
+ reply_fn,
+ arg);
+}
+
/** Try to tell a cpuworker to perform the public key operations necessary to
* respond to <b>onionskin</b> for the circuit <b>circ</b>.
*
void cpu_init(void);
void cpuworkers_rotate_keyinfo(void);
+struct workqueue_entry_s;
+enum workqueue_reply_t;
+struct workqueue_entry_s *cpuworker_queue_work(
+ enum workqueue_reply_t (*fn)(void *, void *),
+ void (*reply_fn)(void *),
+ void *arg);
struct create_cell_t;
int assign_onionskin_to_cpuworker(or_circuit_t *circ,