Raised This Month: $32 Target: $400
 8% 

ThreadExecute Fix Old version CreateThreadB server error


Post New Thread Reply   
 
Thread Tools Display Modes
201724
Member
Join Date: May 2011
Old 10-14-2011 , 12:02   Re: ThreadExecute Modules!
Reply With Quote #11

Quote:
Originally Posted by xPaw View Post
Is it really threaded? Is this going to hang the server? Can't really test right now.

Code:
#include < amxmodx ></p><p>#include < thread ></p><p>&nbsp;</p><p>public plugin_init( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;register_srvcmd( "test", "CommandTest" );</p><p>}</p><p>&nbsp;</p><p>public CommandTest( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;CreateThread( "ThreadHangMe" );</p><p>}</p><p>&nbsp;</p><p>public ThreadHangMe( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;new i = 1;</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;while( i++ > 0 )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;if( i % 500 )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log_amx( "%i passed.", i );</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;&nbsp;}</p><p>}

Overflow

Last edited by 201724; 10-14-2011 at 12:07.
201724 is offline
Send a message via MSN to 201724
201724
Member
Join Date: May 2011
Old 10-14-2011 , 12:07   Re: ThreadExecute Modules!
Reply With Quote #12

Quote:
Originally Posted by xPaw View Post
Is it really threaded? Is this going to hang the server? Can't really test right now.

Code:
#include < amxmodx ></p><p>#include < thread ></p><p>&nbsp;</p><p>public plugin_init( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;register_srvcmd( "test", "CommandTest" );</p><p>}</p><p>&nbsp;</p><p>public CommandTest( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;CreateThread( "ThreadHangMe" );</p><p>}</p><p>&nbsp;</p><p>public ThreadHangMe( )</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;new i = 1;</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;while( i++ > 0 )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;if( i % 500 )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log_amx( "%i passed.", i );</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;&nbsp;}</p><p>}
the
public ThreadHangMe( )
{
new i = 1;

while( i++ > 0 )
{
if( i % 500 )
{
log_amx( "%d passed.", i );
}
}
}

is buffer Overflow
201724 is offline
Send a message via MSN to 201724
Sho0ter
Member
Join Date: Oct 2009
Location: Ukraine
Old 10-14-2011 , 16:26   Re: ThreadExecute Modules!
Reply With Quote #13

Quote:
Originally Posted by 201724 View Post
Overflow
You forgot
Code:
Sleep(1);
__________________
Sry for my bad english. Im using translator.
Sho0ter is offline
Send a message via ICQ to Sho0ter Send a message via Skype™ to Sho0ter
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode