add skynet.blockcall

This commit is contained in:
云风
2012-09-05 14:34:09 +08:00
parent 2126f54d72
commit a00016025e
6 changed files with 115 additions and 18 deletions

View File

@@ -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);