Welcome to the new Linux Foundation Forum!

suspend other posix thread(s)

I just got this fancy application called `ags` see sourceforge.net/p/ags

During compilation I get the following error:

ags-ags_thread.o: In function `ags_thread_real_timelock':

/home/joel/ags-code/./src/ags/thread/ags_thread.c:1620: undefined reference to `pthread_suspend'

/home/joel/ags-code/./src/ags/thread/ags_thread.c:1660: undefined reference to `pthread_resume'

because the listed functions don't exist on debian GNU/Linux. How can I install the pthread library that provides those functions ...

Comments

  • Now I write a module that uses pth instead of pthread library.
  • weedlightweedlight Posts: 54
    edited July 2014
    The code looks like following:
    void
    ags_thread_suspend_handler(int sig)
    {
    #ifdef AGS_DEBUG
      g_message("thread suspend\0");
    #endif
    
      if(ags_thread_self == NULL)
        return;
    
      if ((AGS_THREAD_SUSPENDED & (g_atomic_int_get(&(ags_thread_self->flags)))) != 0) return;
    
      g_atomic_int_or(&(ags_thread_self->flags),
                      AGS_THREAD_SUSPENDED);
    
      ags_thread_suspend(ags_thread_self);
    
      do sigsuspend(&(ags_thread_self->wait_mask)); while ((AGS_THREAD_SUSPENDED & (g_atomic_int_get(&(ags_thread_self->flags)))) != 0);
    }
    

    And is triggered like this:
    pthread_kill(thread_id, AGS_THREAD_RESUME_SIG);
    
Sign In or Register to comment.