Re: [PATCH] MSVC: Windows-native implementation for subset of Pthreads API

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

 



On Thu, 5 Nov 2009, Andrzej K. Haczewski wrote:

> +static unsigned __stdcall win32_start_routine(void *arg)
> +{
> +	pthread_t *thread = arg;
> +	thread->value = thread->start_routine(thread->arg);
> +	return 0;
> +}

I suppose you could reuse thread->arg for both the argument and the 
returned value to save a word.

> +int win32_pthread_join(pthread_t *thread, void **value_ptr)
> +{
> +	DWORD result = WaitForSingleObject((HANDLE)thread->handle, INFINITE);

Why are you casting thread->handle here?  Why not simply declaring it as 
a HANDLE?

Otherwise this looks pretty good now.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]