NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Dealing with absence of PTHREAD_MUTEX_ERRORCHECK_NP in NetBSD [ Was Re: XSB Prolog added to wip ]



[Cross-posting from pkgsrc-users list with a more focused subject line.]

On Sat, Aug 13, 2022 at 01:09:17AM +0530, Mayuresh wrote:
> In particular, I am unsure about this patch. PTHREAD_MUTEX_ERRORCHECK_NP
> isn't available on NetBSD 9.x (may be it would come in 10). I just
> replaced it with PTHREAD_MUTEX_ERRORCHECK, but not sure what is the right
> patch for this.
> 
>     +#if defined(__NetBSD__)
>     +#    define PTHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
>     +#endif

man pthread_mutexattr provides the available values in NetBSD 9.2.

Snippet with a little bit of surrounding context:

    static void init_mq_table(void)
    {
      int i, status;
    
      pthread_mutexattr_init( &attr_errorcheck_gl );
      status = pthread_mutexattr_settype( &attr_errorcheck_gl,PTHREAD_MUTEX_ERRORCHECK_NP );
      if ( status )
        xsb_initialization_exit("Error (%s) initializing errorcheck mutex attr -- exiting\n",
                    strerror(status));

Full application and patch are available in pkgsrc wip/xsb.

-- 
Mayuresh


Home | Main Index | Thread Index | Old Index