Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixbug #5

Merged
merged 2 commits into from
Dec 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skynet-src/skynet_harbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ skynet_harbor_register(struct remote_name *rname) {

int
skynet_harbor_message_isremote(uint32_t handle) {
return !(handle & HARBOR);
return (handle & ~HANDLE_MASK) != HARBOR;
}

void
Expand Down
2 changes: 1 addition & 1 deletion skynet-src/skynet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ skynet_context_new(const char * name, const char *param) {
ctx->handle = skynet_handle_register(ctx);
struct message_queue * queue = ctx->queue = skynet_mq_create(ctx->handle);
// init function maybe use ctx->handle, so it must init at last
_context_inc();

CHECKCALLING_BEGIN(ctx)
int r = skynet_module_instance_init(mod, inst, ctx, param);
Expand All @@ -116,7 +117,6 @@ skynet_context_new(const char * name, const char *param) {
if (ret) {
printf("[:%x] launch %s %s\n",ret->handle, name, param ? param : "");
}
_context_inc();
return ret;
} else {
skynet_context_release(ctx);
Expand Down