Work in progress
This work extends AIStateMachine to run multiplex() in the thread that calls run(), cont() or set_state(). Note that all three eventually call locked_cont(), so thats where multiplex() is called from. Calling multiplex() means "running the state machine", as in "calling multiplex_impl". Currently only LLURLRequest uses this feature, and then only for the HTTPGetResponder, and well only for the initializing, start up and normal finish states. A current/remaining problem is that we run into a situation where the curl thread runs a statemachine to it's finish and kills it, while the main thread is also 'running' it and tries to call multiplex while the statemachine isn't running anymore.
This commit is contained in:
@@ -35,6 +35,15 @@
|
||||
#include "aitimer.h"
|
||||
#include "aicurl.h"
|
||||
|
||||
enum curleasyrequeststatemachine_state_type {
|
||||
AICurlEasyRequestStateMachine_addRequest = AIStateMachine::max_state,
|
||||
AICurlEasyRequestStateMachine_waitAdded,
|
||||
AICurlEasyRequestStateMachine_timedOut, // This must be smaller than the rest, so they always overrule.
|
||||
AICurlEasyRequestStateMachine_removed, // The removed states must be largest two, so they are never ignored.
|
||||
AICurlEasyRequestStateMachine_removed_after_finished,
|
||||
AICurlEasyRequestStateMachine_bad_file_descriptor
|
||||
};
|
||||
|
||||
// A curl easy request state machine.
|
||||
//
|
||||
// Before calling cersm.run() initialize the object (cersm) as follows:
|
||||
|
||||
Reference in New Issue
Block a user