no pthread_yield() on netbsd

Bug #287090 reported by jym
6
Affects Status Importance Assigned to Milestone
PBXT
Fix Released
Undecided
Paul McCullagh

Bug Description

pthread_yield() function doesn't exist on netbsd. Use sched_yield() instead.

 With this modification, compilation is OK on Netbsd. MacosX seems to have the same problem (but I did not try to compile pbxt on it).

jym

Related branches

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi JYM,

Thanks for the bug report! Please check if the following code solves the problem:

xtPublic void xt_yield(void)
{
#ifdef XT_WIN
 Sleep(0);
#elif defined(XT_MAC)
 usleep(0);
#else
#if defined(__NetBSD__)
 sched_yield();
#else
 pthread_yield();
#endif
#endif
}

Revision history for this message
jym (jym) wrote : Re: [Bug 287090] Re: no pthread_yield() on netbsd

Hello,

Sorry for the late reply..

yes, that's ok for this file. But I now have another problem with
compilation. (I have a netbsd updated to current and mysql 5.1.28:
(gcc v4.1.3)

When linking mysqld (I'm compiling pbxt in mysql):
 undefined reference to `typeinfo for handler'

I will see that error as soon as possible. And try the latest mysql.
I will keep you updated.

Thank you, and Greetings from Paris.
jym

Paul McCullagh à écris:
> Hi JYM,
>
> Thanks for the bug report! Please check if the following code solves the
> problem:
>
> xtPublic void xt_yield(void)
> {
> #ifdef XT_WIN
> Sleep(0);
> #elif defined(XT_MAC)
> usleep(0);
> #else
> #if defined(__NetBSD__)
> sched_yield();
> #else
> pthread_yield();
> #endif
> #endif
> }
>
> --
> no pthread_yield() on netbsd
> https://bugs.launchpad.net/bugs/287090
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in PrimeBase XT: New
>
> Bug description:
> pthread_yield() function doesn't exist on netbsd. Use sched_yield() instead.
>
> With this modification, compilation is OK on Netbsd. MacosX seems to have the same problem (but I did not try to compile pbxt on it).
>
> jym
>

Changed in pbxt:
assignee: nobody → paul-mccullagh
status: New → Incomplete
Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

Hi JYM,

the problem with missing reference is on MySQL side. To make things work you will need to conifugre MySQL with the following option: --with-mysqld-ldflags=-export-dynamic

e.g.:

./configure --with-extra-charsets=complex --with-mysqld-ldflags=-export-dynamic
make
make install (as root)

This worked for me. However I had some problems using PBXT right after the INSTALL PLUGIN command. So I had to restart MySQL server and after that everything worked fine.

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

And we have pushed the xt_yield() bug fix to 1.0.07, so I am closing this bug.

Changed in pbxt:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.