summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
AgeCommit message (Collapse)Author
2011-03-05Replaced Common::CriticalSection with a std::mutex implementation. 64bit ↵Jordan Woyak
Windows builds now use SRWLocks and ConditionVariables(requires Vista/7, x64 builds will no longer work on Windows XP x64). Tell me if you hate that. Removed Common::EventEx. Common::Event now uses a std::condition_variable impl.(using ConditionVariables on Windows x64, Events on x86, or posix condition variables elsewhere). I experience slight speed improvements with these changes. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7294 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-02Thread affinity on OS X and *BSD.Soren Jorvang
Keep building the software plugin to prevent rot. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7045 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-27Replaced Common::Thread with a partial implementation of std::thread. ↵Jordan Woyak
(rvalue references are used if available, <thread> is used if possible) Eliminates the need to use dynamic memory allocation for threads, so it's impossible to forget to delete a thread or set a pointer to NULL. Enables use of type-safe thread functions, no need to cast to and from void*. I've made sure the code compiles in vs08 and tested the functionality of "StdThread.h" on Linux so I'm hoping everything will work :p. In the future "StdThread.h" can be removed (maybe when OS X ships with gcc 4.4 and vs2015 is released :p). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6933 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-05First pass at dealing with different size_t/off_t sizes in C90 environments.Soren Jorvang
Most of the code dealing with the LogTypes namespace was C which lead to a lot of nonsensical casting, so I have dumbed LOG_TYPE and LOG_LEVEL down to plain C even though the move of wiiuse into Source means we don't currently call GenericLog from C. Set logging threshold to MAX_LOGLEVEL at startup so debug builds will also p rint debugging messages before the GUI is running. For some reason the way we use SetDefaultStyle doesn't play nice with wx 2.9 so we just get the default black text on a black background. Using a gray background works around that problem, but I found it to also be much easier on the eyes so I have switched the background color on all versions. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6528 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-22Revert to gettimeofday on posix systems. I give up.Glenn Rice
Temporary fix for OSX in JitIL.cpp This revision should build on OSX again. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6457 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-20Fix ogl screenshots for windows.Glenn Rice
Fix the macosx build (perhaps). This changes the JitIL timed profiling to using assembly language to obtain the time. It does seem to be faster. Not sure if it will work on macosx, but if it does it has the necessary precision that gettimeofday does not have. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6448 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-20Implement JitIL profiling on linux. I also tried implementing __rdtsc using ↵Glenn Rice
assembly and didn't really see a speed improvement so went with clock_gettime. Also changed other gettimeofday calls to clock_gettime, which is supposedly more accurate. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6447 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-09-30Apply u-ra's patch to speed up CriticalSection on systems that use ↵j4ck.fr0st
POSIX-threads (that is, not windows). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6242 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-06Implement proper thread naming on linux. This fixes a segmentation fault ↵Glenn Rice
with thte wiimote new configuration dialog when a thread was named without first calling ThreadInit. Also take care of some more eols. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5843 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-16Linux build fix.ayuanx
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5725 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-29Massive Poo storm, had to take shelter. Hacks, fixes, etc etcSonicadvance1
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5421 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-29[OSX] Use spinlocks instead of mutexes since mutexes are really semaphores, ↵Sonicadvance1
gives me a decent speed up. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5420 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-17possible savestate memory leak fix in DoBuffernitsuja-
made Lua run on the CPU thread to fix unreliable script execution issues several fixes so the Lua savestate functions can actually work added Lua function savestate.verify to help with catching desyncs implemented FailVerifyAtFrameBoundary in Lua interface added a Clear button to the LuaWindow git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5382 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-14うそ!Sonicadvance1
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5057 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-14Bunch of tiny memory leaks fixed and cleanup, フウ〜!Sonicadvance1
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5056 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-14This could alleviate the suffering of dual core synchronization a bit.ayuanx
But I doubt you would notice it in most cases. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4830 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-09from BhaaL: linux compile fix for r4794, Event::Wait now supports a timeout ↵Shawn Hoffman
(default to INFINITE), and it returns true when the timeout expired. fixes issue 1974 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4799 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-09-07GUI: Fixed some GUI related start/stop crashesJohn Peterson
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4223 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-08-06misc cleanupShawn Hoffman
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3942 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-31Fix noWX build, and lower thread priority for screenshots sl1nk3.s
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3913 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-28Now ALL copyright dates are fixed to the legally correct year: The year in ↵XTra.KrazzY
which the project began. Now we don't have to change it every year :) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3898 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-15Fixed one of the two remaining crash on Stop (issue 600), and removed some ↵sl1nk3.s
setup defines which are now useless anyway. There's an attempt to implement Peek_Color too, probably done wrong :P git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3799 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-13Atomic operations library.Nolan Check
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3775 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-11fig ConfigPadDlg size in linux, temporary linux build fixLPFaint99
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3742 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-07-10Use _beginthreadexNolan Check
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3736 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-28Some code cleanupomegadox
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2768 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-20Fixed some log messagesnakeee
Fixed a crash when no game ini exists git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2690 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-18nakee's new logmanager. added a console window for windows builds (prints to ↵Shawn Hoffman
parent console on non-win32). also fix some random wxw bugs: main window's position is saved when using debugger, disabling windows from the tools menu are saved settings, some other small fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2675 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-24Linux build fixes and some warning cleanup for GCComegadox
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2406 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-24Last Commit (Threads and Stop): Linux build fix, I forgot to change the ↵John Peterson
definition of the function there to git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2402 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-24Threads and Stop: How about this? A timeout only for the shutdown process? ↵John Peterson
That way the shutdown can either work anyway, or crash, which is simpler than having to open the Task Manager and manually end the deadlocked process. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2401 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-23Restore proper functionality of events and thread waits. The arbitrary 5 sec ↵hrydgard
timeout ( ??? ) broke stepping in the debugger. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2397 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-23Core and Common Threads Stop and Start: Added timeout to the thread waiting ↵John Peterson
loops. If we have waited more than five seconds we can be pretty sure that the thread is deadlocked. So then we can just as well continue and hope for the best. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2383 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-22Attempt to workaround some stop hangs by using MsgWait instead of Wait. ↵hrydgard
change order of dsp / video shutdown. some comments. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2379 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-22Core Stop and Start: Added alternative separate thread timer/loop based ↵John Peterson
waiting, instead of same thread loop waiting. You can try it with the SETUP_TIMER_WAITING option in Setup.h. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2375 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-02-20The Mega Change Of Doom - or, fixing Stop. Almost. At least it's better than ↵hrydgard
before. However, the OpenGL plugin seems to lose textures a lot between game restarts :P I think the GL plugin needs to do a lot more cleanup. This change also includes tons of minor code formatting cleanup. Yeah, should've separated it ... sorry :( Kills the old CPUCompare support. I'll resurrect it if I need it again, right now it mostly clutters the code. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2321 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-01-11fixXTra.KrazzY
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1850 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-01-11Printf compile warning fixesXTra.KrazzY
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1849 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-01-09properly support POSIX threads kthxbushing
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1838 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-12-13small speedup of logmanager, minor logging improvements, misc code standard ↵hrydgard
improvements, replace a crash with an error message in ppcanalyst git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1521 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-12-08set svn:eol-style=native for **.cppbushing
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1442 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-12-06add support for GCC 4.0bushing
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1407 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-12-04Fix windows build. Fix InterlockedIncrement for old gcc. TOTEST on linux.memberTwo.mb2
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1394 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-12-04merged windows/linux atomic operations,nakeee
please test on windows git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1391 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-11-24DC + fifo: small fix/correction ;). Remove old stupid OnIdleDC stuff. ↵memberTwo.mb2
Interesting: DSPnull with DC + IdleSkipping show invalid read addr sometimes. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1286 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-11-23Moved wiimote_test to wiimotenakeee
Some linux compile fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1266 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-11-15more portingnakeee
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1183 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-10-30Added InterlockedExchange to Linux sideSonicadvance1
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1018 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-10-17add InterlockedExchangeAdd for olds gcc versiontmator
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@898 8ced0084-cf51-0410-be5f-012b33b47a6e
2008-10-09Fix Building in Linux, removed the define for _T() in Common.h so now we can ↵Sonicadvance1
have wx headers after including Common.h. Also, InterlockedExchange isn't in Linux so I just made it assign the variable git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@809 8ced0084-cf51-0410-be5f-012b33b47a6e