Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 31st, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DWORD WINAPI Set_prior( LPVOID lpParam )
  2. {
  3.     Parameter* p = (Parameter*)lpParam;
  4.     int blocked = -1;
  5.     while(1)
  6.     {
  7.        
  8.         //long int time_ms = (( clock()-p->start_time  ) * 1000 / CLOCKS_PER_SEC );
  9.        
  10.         DWORD time_ms = timeGetTime() - p->start;
  11.         if( time_ms % 300 == 0 && time_ms != 0 && blocked !=time_ms )// && time_ms != 0 && time_ms != blocked ) // zmienna blocked uniemozliwia wejscie do tego ifa wiecej niz raz w tej samej milisekundzie
  12.  
  13.         {
  14.             blocked = time_ms;
  15.             for( int i = 0; i < p->nSize; i++ )
  16.                 SuspendThread( p->thread_handles[i] );
  17.            
  18.             //EnterCriticalSection( &cs );
  19.             printf( "\n%d\n", timeGetTime() - p->start );
  20.            
  21.             int min = p->stored_value[0];
  22.             int max = p->stored_value[0];
  23.             for( int i = 1; i < p->nSize; i++ )
  24.             {
  25.  
  26.                 if( min > p->stored_value[i] )
  27.                     min = p->stored_value[i];
  28.                 if( max < p->stored_value[i] )
  29.                     max = p->stored_value[i];
  30.             }
  31.             for( int i = 0; i < p->nSize; i++ )
  32.             {
  33.                 //if( hektor->kupione[i] == min )
  34.                 if( p->stored_value[i] == min )
  35.                 {
  36.                     SetThreadPriority(p->thread_handles[i], 2 );
  37.                     printf( "Ochroniarz: Klient %c Zapraszam\n", p->names[i] );
  38.                    
  39.                 }
  40.                 //else if( hektor->kupione[i] == max )
  41.                 else if( p->stored_value[i] == max )
  42.                 {
  43.                     SetThreadPriority( p->thread_handles[i], -2 );
  44.                     printf( "Ochroniarz: Klient %c Na Koniec\n", p->names[i] );
  45.                 }
  46.                 else SetThreadPriority( p->thread_handles[i], 0 );
  47.  
  48.  
  49.  
  50.             }
  51.             for( int i = 0; i < p->nSize; i++ )
  52.                 ResumeThread( p->thread_handles[i] );
  53.             //LeaveCriticalSection( &cs );
  54.         }
  55.     }
  56.     return 0;
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top