// Copyright (C) 2001-2003 // William E. Kempf // Copyright (C) 2007 Anthony Williams // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #ifdef BOOST_HAS_MPTASKS #include #include #include #include #include namespace { void *remote_call_proxy(void *pData) { std::pair &rData( *reinterpret_cast *>(pData)); if(*rData.second == false) { rData.first(); *rData.second = true; } return(NULL); } } namespace boost { void call_once(once_flag& flag, void (*func)()) { if(flag == false) { // all we do here is make a remote call to blue, as blue is not // reentrant. std::pair sData(func, &flag); MPRemoteCall(remote_call_proxy, &sData, kMPOwningProcessRemoteContext); assert(flag == true); } } } #endif