#5693: Implement pthread spinlocks (easy) ---------------------------+------------------------------------------------ Reporter: bonefish | Owner: nobody Type: enhancement | Status: closed Priority: normal | Milestone: R1 Component: System/POSIX | Version: R1/Development Resolution: fixed | Keywords: Blockedby: | Platform: All Blocking: | ---------------------------+------------------------------------------------ Comment(by bonefish): Replying to [comment:7 lucian]: > Something's wrong, but I can't figure it out and I don't want to be chasing wild geese. The implementation you submitted fails one test: {{{pthread_spin_trylock}}} seems to return {{{-EBUSY}}} instead of the expected {{{EBUSY}}}. > > In code I have {{{return EBUSY;}}}, but the value returned to the user is equal to the user's {{{-EBUSY}}}. I may have a different {{{EBUSY}}} definition than the library's user. Am I including the wrong headers, or forgot to define something? Since (due to BeOS compatibility) Haiku's error codes are negative while POSIX demands positive values, the test suite is built with {{{-lposix_error_mapper -DB_USE_POSITIVE_POSIX_ERRORS}}}. The define makes all error code constants positive, the library provides wrappers for all functions that return or deal with error codes. I added the spinlock function wrappers in r36334. If you have built the test suite before that revision, +/- problems are to be expected. -- Ticket URL: <http://dev.haiku-os.org/ticket/5693#comment:8> Haiku <http://dev.haiku-os.org> Haiku - the operating system.