mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
Enabled new File Transfer Code in libretroshare.
NB: This is not yet working. so SVN is now officially broken :( Hope to have the bugs ironed out soon. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@782 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9f68fc5393
commit
0d96b43d34
29 changed files with 567 additions and 117 deletions
|
@ -28,6 +28,14 @@
|
|||
#include "rsthreads.h"
|
||||
#include <unistd.h> /* for usleep() */
|
||||
|
||||
/*******
|
||||
* #define DEBUG_THREADS 1
|
||||
*******/
|
||||
|
||||
#ifdef DEBUG_THREADS
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
extern "C" void* rsthread_init(void* p)
|
||||
{
|
||||
RsThread *thread = (RsThread *) p;
|
||||
|
@ -79,6 +87,12 @@ void RsQueueThread::run()
|
|||
mLastWork = now;
|
||||
mLastSleep = (uint32_t)
|
||||
(mMinSleep + (mLastSleep - mMinSleep) / 2.0);
|
||||
#ifdef DEBUG_THREADS
|
||||
std::cerr << "RsQueueThread::run() done work: sleeping for: " << mLastSleep;
|
||||
std::cerr << " ms";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -91,6 +105,11 @@ void RsQueueThread::run()
|
|||
{
|
||||
mLastSleep = mMaxSleep;
|
||||
}
|
||||
#ifdef DEBUG_THREADS
|
||||
std::cerr << "RsQueueThread::run() no work: sleeping for: " << mLastSleep;
|
||||
std::cerr << " ms";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
#ifdef WIN32
|
||||
Sleep(mLastSleep);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue