- if (oid_init_flag)
- return;
- /* oid_transfer is thread safe, so there's nothing wrong in having
- two threads calling it simultaniously. On the other hand
- no thread may exit oid_init before all OID's bave been
- transferred - which is why checked is set after oid_transfer...
- */
- nmem_mutex_create (&oid_mutex);
- nmem_mutex_enter (oid_mutex);
- if (!oid_nmem)
- oid_nmem = nmem_create ();
- nmem_mutex_leave (oid_mutex);
- oid_transfer (standard_oids);
- oid_init_flag = 1;
+ if (oid_init_flag == 0)
+ {
+ /* oid_transfer is thread safe, so there's nothing wrong in having
+ two threads calling it simultaniously. On the other hand
+ no thread may exit oid_init before all OID's bave been
+ transferred - which is why checked is set after oid_transfer...
+ */
+ nmem_mutex_create (&oid_mutex);
+ nmem_mutex_enter (oid_mutex);
+ if (!oid_nmem)
+ oid_nmem = nmem_create ();
+ nmem_mutex_leave (oid_mutex);
+ oid_transfer (standard_oids);
+ oid_init_flag = 1;
+ }