mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
@@ -34,7 +34,7 @@ skynet_harbor_register(struct remote_name *rname) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
skynet_harbor_message_isremote(uint32_t handle) {
|
skynet_harbor_message_isremote(uint32_t handle) {
|
||||||
return !(handle & HARBOR);
|
return (handle & ~HANDLE_MASK) != HARBOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ skynet_context_new(const char * name, const char *param) {
|
|||||||
ctx->handle = skynet_handle_register(ctx);
|
ctx->handle = skynet_handle_register(ctx);
|
||||||
struct message_queue * queue = ctx->queue = skynet_mq_create(ctx->handle);
|
struct message_queue * queue = ctx->queue = skynet_mq_create(ctx->handle);
|
||||||
// init function maybe use ctx->handle, so it must init at last
|
// init function maybe use ctx->handle, so it must init at last
|
||||||
|
_context_inc();
|
||||||
|
|
||||||
CHECKCALLING_BEGIN(ctx)
|
CHECKCALLING_BEGIN(ctx)
|
||||||
int r = skynet_module_instance_init(mod, inst, ctx, param);
|
int r = skynet_module_instance_init(mod, inst, ctx, param);
|
||||||
@@ -116,7 +117,6 @@ skynet_context_new(const char * name, const char *param) {
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
printf("[:%x] launch %s %s\n",ret->handle, name, param ? param : "");
|
printf("[:%x] launch %s %s\n",ret->handle, name, param ? param : "");
|
||||||
}
|
}
|
||||||
_context_inc();
|
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
skynet_context_release(ctx);
|
skynet_context_release(ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user