]> git.sesse.net Git - stockfish/commit
Remove last platform specific code form thread.cpp
authorMarco Costalba <mcostalba@gmail.com>
Fri, 23 Mar 2012 12:12:26 +0000 (13:12 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 23 Mar 2012 18:28:20 +0000 (19:28 +0100)
commit06f33ff1ee0c0e8345cb6d5b84ce5db9f043203d
tree1e0000ad41a29ff7eb93d467f3384e27055724a7
parentc47a74ec62c8c4fdacf6d16eef068b62634122f1
Remove last platform specific code form thread.cpp

A somewhat tricky function pointer cast allows us
to move the platform specifics to lock.h, the cast
is tricky because return type is not the same of the
casted function in Linux (for Windows return type is
a DWORD that is a long) but this should not be a
problem as long as the size is the same;

From: http://stackoverflow.com/questions/188839/function-pointer-cast-to-different-signature

"OpenSSL was only casting functions pointers to
other function types taking and returning the same
number of values of the same exact sizes, and this
(assuming you're not dealing with floating-point)
happens to be safe across all the platforms and
calling conventions I know of. However, anything
else is potentially unsafe."

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/lock.h
src/thread.cpp