[PATCH v2 1/2] vkd3d: On apple, implement pthread_spinlock_t with os_unfair_lock.

Chip Davis cdavis at codeweavers.com
Thu Sep 12 13:04:43 CDT 2019


September 12, 2019 10:25 AM, "Derek Lesho" <dlesho at codeweavers.com> wrote:

> diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h
> index 1ac8a63..c6a0946 100644
> --- a/include/private/vkd3d_common.h
> +++ b/include/private/vkd3d_common.h
> @@ -168,4 +168,40 @@ static inline void vkd3d_parse_version(const char *version, int *major, int *min
>      *minor = atoi(version);
>  }
> 
> +#ifdef __APPLE__
> +#include <os/lock.h>
> +
> +typedef os_unfair_lock pthread_spinlock_t;
> +
> +inline int pthread_spin_init(pthread_spinlock_t *lock, int pshared)
> +{
> +    if (pshared != PTHREAD_PROCESS_PRIVATE) return E_INVALIDARG;

I think you meant EINVAL here. Methinks you've been writing too many COM methods :).


Chip



More information about the wine-devel mailing list