mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
bugfix: harbor service should not release before others
This commit is contained in:
@@ -31,5 +31,17 @@ skynet_harbor_init(int harbor) {
|
||||
|
||||
void
|
||||
skynet_harbor_start(void *ctx) {
|
||||
// the HARBOR must be reserved to ensure the pointer is valid.
|
||||
// It will be released at last by calling skynet_harbor_exit
|
||||
skynet_context_reserve(ctx);
|
||||
REMOTE = ctx;
|
||||
}
|
||||
|
||||
void
|
||||
skynet_harbor_exit() {
|
||||
struct skynet_context * ctx = REMOTE;
|
||||
REMOTE= NULL;
|
||||
if (ctx) {
|
||||
skynet_context_release(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user