Ignore:
Timestamp:
Sep 16, 2020, 1:28:47 AM (5 years ago)
Author:
bird
Message:

kash: Need to initialize mutexes on windows after forking now that we've finally got real mutexes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shinstance.c

    r3467 r3468  
    175175
    176176/**
     177 * Initialize globals in shinstance.c.
     178 *
     179 * Called when creating the rootshell and on windows after forking.
     180 */
     181void sh_init_globals(void)
     182{
     183    assert(g_sh_mtx.au64[SHMTX_MAGIC_IDX] != SHMTX_MAGIC);
     184    shmtx_init(&g_sh_mtx);
     185#ifndef SH_FORKED_MODE
     186    shmtx_init(&g_sh_exec_inherit_mtx);
     187    shmtx_init(&g_sh_sts_mtx);
     188#endif
     189}
     190
     191
     192/**
    177193 * Links the shell instance.
    178194 *
     
    709725    shinstance *psh;
    710726
    711     assert(g_sh_mtx.au64[SHMTX_MAGIC_IDX] != SHMTX_MAGIC);
    712     shmtx_init(&g_sh_mtx);
    713 #ifndef SH_FORKED_MODE
    714     shmtx_init(&g_sh_exec_inherit_mtx);
    715     shmtx_init(&g_sh_sts_mtx);
    716 #endif
     727    sh_init_globals();
    717728
    718729    psh = sh_create_shell_common(argv, envp, NULL /*parentfdtab*/);
Note: See TracChangeset for help on using the changeset viewer.