mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
add skynet.blockcall
This commit is contained in:
@@ -249,7 +249,7 @@ skynet_context_message_dispatch(void) {
|
||||
}
|
||||
|
||||
assert(q == ctx->queue);
|
||||
skynet_mq_force_push(q);
|
||||
skynet_mq_pushglobal(q);
|
||||
skynet_context_release(ctx);
|
||||
|
||||
return 0;
|
||||
@@ -326,6 +326,16 @@ skynet_command(struct skynet_context * context, const char * cmd , const char *
|
||||
return context->result;
|
||||
}
|
||||
|
||||
if (strcmp(cmd,"LOCK") == 0) {
|
||||
if (context->init == 0) {
|
||||
return NULL;
|
||||
}
|
||||
int session = strtol(param, NULL, 10);
|
||||
assert(session);
|
||||
skynet_mq_lock(context->queue, session);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(cmd,"REG") == 0) {
|
||||
if (param == NULL || param[0] == '\0') {
|
||||
sprintf(context->result, ":%x", context->handle);
|
||||
|
||||
Reference in New Issue
Block a user