mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-08 14:10:39 +00:00
o added -workerThreadCountMin;
o added -setWorkerThreadCountMin: o added -workerThreadCountMax o added -setWorkerThreadCountMax: git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18152 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
856b6836bc
commit
e0770de4db
2 changed files with 46 additions and 7 deletions
|
@ -39,6 +39,8 @@ extern int iBlock;
|
||||||
int _instance;
|
int _instance;
|
||||||
int _queueSize;
|
int _queueSize;
|
||||||
int _workerThreadCount;
|
int _workerThreadCount;
|
||||||
|
int _workerThreadCountMin;
|
||||||
|
int _workerThreadCountMax;
|
||||||
BOOL _isMultiThreadEnabled;
|
BOOL _isMultiThreadEnabled;
|
||||||
NSFileHandle* _fileHandle;
|
NSFileHandle* _fileHandle;
|
||||||
NSMutableArray* _waitingThreads;
|
NSMutableArray* _waitingThreads;
|
||||||
|
@ -47,7 +49,6 @@ extern int iBlock;
|
||||||
BOOL _blocked;
|
BOOL _blocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)dealloc;
|
|
||||||
-(id)initWithName:(NSString*)name
|
-(id)initWithName:(NSString*)name
|
||||||
arguments:(NSDictionary*)arguments;
|
arguments:(NSDictionary*)arguments;
|
||||||
|
|
||||||
|
@ -68,6 +69,10 @@ extern int iBlock;
|
||||||
|
|
||||||
-(void)setWorkerThreadCount:(id)workerThreadCount;
|
-(void)setWorkerThreadCount:(id)workerThreadCount;
|
||||||
-(id)workerThreadCount;
|
-(id)workerThreadCount;
|
||||||
|
-(void)setWorkerThreadCountMin:(id)workerThreadCount;
|
||||||
|
-(id)workerThreadCountMin;
|
||||||
|
-(void)setWorkerThreadCountMax:(id)workerThreadCount;
|
||||||
|
-(id)workerThreadCountMax;
|
||||||
-(void)setListenQueueSize:(id)listenQueueSize;
|
-(void)setListenQueueSize:(id)listenQueueSize;
|
||||||
-(BOOL)isMultiThreadEnabled;
|
-(BOOL)isMultiThreadEnabled;
|
||||||
-(BOOL)isConnectionAllowedWithHandle:(NSFileHandle*)handle
|
-(BOOL)isConnectionAllowedWithHandle:(NSFileHandle*)handle
|
||||||
|
|
|
@ -71,6 +71,8 @@ int allow_severity = LOG_INFO;
|
||||||
// [self setInstance:_instance];
|
// [self setInstance:_instance];
|
||||||
_queueSize=[[arguments objectForKey:GSWOPT_ListenQueueSize[GSWebNamingConv]] intValue];
|
_queueSize=[[arguments objectForKey:GSWOPT_ListenQueueSize[GSWebNamingConv]] intValue];
|
||||||
_workerThreadCount=[[arguments objectForKey:GSWOPT_WorkerThreadCount[GSWebNamingConv]] intValue];
|
_workerThreadCount=[[arguments objectForKey:GSWOPT_WorkerThreadCount[GSWebNamingConv]] intValue];
|
||||||
|
_workerThreadCountMin=[[arguments objectForKey:GSWOPT_WorkerThreadCountMin[GSWebNamingConv]] intValue];
|
||||||
|
_workerThreadCountMax=[[arguments objectForKey:GSWOPT_WorkerThreadCountMax[GSWebNamingConv]] intValue];
|
||||||
_isMultiThreadEnabled=[[arguments objectForKey:GSWOPT_MultiThreadEnabled] boolValue];
|
_isMultiThreadEnabled=[[arguments objectForKey:GSWOPT_MultiThreadEnabled] boolValue];
|
||||||
ASSIGN(_adaptorHost,[arguments objectForKey:GSWOPT_AdaptorHost[GSWebNamingConv]]);
|
ASSIGN(_adaptorHost,[arguments objectForKey:GSWOPT_AdaptorHost[GSWebNamingConv]]);
|
||||||
};
|
};
|
||||||
|
@ -193,15 +195,15 @@ int allow_severity = LOG_INFO;
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setWorkerThreadCount:(id)workerThreadCount
|
-(void)setWorkerThreadCountMin:(id)workerThreadCount
|
||||||
{
|
{
|
||||||
if ([self tryLock])
|
if ([self tryLock])
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_workerThreadCount=[workerThreadCount intValue];
|
_workerThreadCountMin=[workerThreadCount intValue];
|
||||||
if (_workerThreadCount<1)
|
if (_workerThreadCountMin<1)
|
||||||
_workerThreadCount=1;
|
_workerThreadCountMin=1;
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -219,9 +221,41 @@ int allow_severity = LOG_INFO;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)workerThreadCount
|
-(id)workerThreadCountMin
|
||||||
{
|
{
|
||||||
return [NSNumber numberWithInt:_workerThreadCount];
|
return [NSNumber numberWithInt:_workerThreadCountMin];
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)setWorkerThreadCountMax:(id)workerThreadCount
|
||||||
|
{
|
||||||
|
if ([self tryLock])
|
||||||
|
{
|
||||||
|
NS_DURING
|
||||||
|
{
|
||||||
|
_workerThreadCountMax=[workerThreadCount intValue];
|
||||||
|
if (_workerThreadCountMax<1)
|
||||||
|
_workerThreadCountMax=1;
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
LOGException(@"%@ (%@)",
|
||||||
|
localException,
|
||||||
|
[localException reason]);
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
|
[self unlock];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(id)workerThreadCountMax
|
||||||
|
{
|
||||||
|
return [NSNumber numberWithInt:_workerThreadCountMax];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue