void * thread_context(void *_tx) { thread_context_s *tx = (thread_context_s*)_tx; pthread_mutex_lock(&mutex_lua); // call the `lua_func` lua_func(tx->L, tx->tid, "hello world"); pthread_mutex_unlock(&mutex_lua); }
bool if2k_lua_interpreter::if_url_error( const jdk_string &error_name, if2k_lua_web_response &ret, const jdk_string &client_ip, const jdk_http_request_header &request_header ) { jdk_str<1024> lua_func("if_url_error_"); lua_func.cat( error_name ); jdk_debug_block( "if2k_lua_interpreter::if_url_error()" ); ret.clear(); jdk_synchronized(mutex); jdk_lua_call( get_l(), lua_func.c_str(), ret, client_ip, request_header ); return ret.contents.get_data_length()>0; }