'Acquire the GIL. The thread\'s thread state must have been initialized
by a previous `put_release_gil`'

def put_acquire_gil(self, variable=None):

    if self.globalstate.directives['fast_gil']:
        self.globalstate.use_utility_code(UtilityCode.load_cached('FastGil', 'ModuleSetupCode.c'))
    else:
        self.globalstate.use_utility_code(UtilityCode.load_cached('NoFastGil', 'ModuleSetupCode.c'))
    self.putln('#ifdef    WITH_THREAD')
    self.putln('__Pyx_FastGIL_Forget();')
    if variable:
        self.putln(('_save    =    %s;' % variable))
    self.putln('Py_BLOCK_THREADS')
    self.putln('#endif')
