using mutex_lock / unlock with VS .NET 2003

Daniel Starin ds708@columbia.edu
Fri Dec 17 05:30:00 GMT 2004


Ahhh solved my own problem... had to turn off the "Use Managed Extensions"
configuration option... anyone care to explain why?

Dan

-----Original Message-----
From: pthreads-win32-owner@sources.redhat.com
[mailto:pthreads-win32-owner@sources.redhat.com] On Behalf Of Daniel Starin
Sent: Thursday, December 16, 2004 11:17 PM
To: pthreads-win32@sources.redhat.com
Subject: using mutex_lock / unlock with VS .NET 2003

Hi,

The following code compiles and links but fails with the following exception
when I run the .exe.  (I link to pthreadVC1.lib)

Unhandled Exception: System.TypeLoadException: Could not load type
pthread_mutex_t_ from assembly pthreadtest, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null.
   at main()

Any suggestions??

Thanks,

Dan
-------------------------------------
#include <pthread.h>

#include "winsock2.h"
#include <stdio.h>

pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

int main () {

	pthread_mutex_lock(&mutex);
	printf("hello");
	pthread_mutex_unlock(&mutex);

	return 0;
}



More information about the Pthreads-win32 mailing list