diff options
Diffstat (limited to 'libports/create-bucket.c')
-rw-r--r-- | libports/create-bucket.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libports/create-bucket.c b/libports/create-bucket.c index 82c00a4b..81fe044c 100644 --- a/libports/create-bucket.c +++ b/libports/create-bucket.c @@ -24,6 +24,15 @@ #include <stdlib.h> #include <hurd/ihash.h> +static struct port_class *notify_port_class; +static pthread_once_t init_notify_port_class_once = PTHREAD_ONCE_INIT; + +static void +init_notify_port_class () +{ + notify_port_class = ports_create_class (NULL, NULL); +} + struct port_bucket * ports_create_bucket () { @@ -49,5 +58,19 @@ ports_create_bucket () hurd_ihash_init (&ret->htable, offsetof (struct port_info, hentry)); ret->rpcs = ret->flags = ret->count = 0; _ports_threadpool_init (&ret->threadpool); + + /* Create the notify_port for this bucket. */ + pthread_once (&init_notify_port_class_once, init_notify_port_class); + err = ports_create_port (notify_port_class, ret, + sizeof (struct port_info), + &ret->notify_port); + if (err) + { + hurd_ihash_destroy (&ret->htable); + free (ret); + errno = err; + return NULL; + } + return ret; } |