We are looking for a portable, simple and elegant replacement for Win32 InterlockedExchangePointer. It is ideal to use only C ++ 11, but boost will do the same.
standard atomic types have an atomic exchange function. So Microsoftese
exchange
PVOID volatile target; old_value = InterlockedExchangePointer(&target, new_value);
will become
std::atomic<T*> target; old_value = target.exchange(new_value);
Source: https://habr.com/ru/post/1215981/More articles:Scala partial sum with current and all past items in a list - arraysNullPointerException with Otto and Dagger - androidjava.lang.UnsupportedOperationException: for security reasons, WebView is not allowed in privileged processes - androidUnsupportedOperationException: WebView not allowed in privileged processes - javaiOS, how to center two views through PureLayout - iosDelphi - Get the current index of the selected item in TListView - delphiWhy does Kotlin lang allow only one main function in a project? - kotlinJQuery ContextMenu event not working on IOS 8.2 - javascriptScreen. Cursor in Firemonkey - delphiHow to change bandwidth in MPAndroidChart BarChart? - androidAll Articles