/*****************************************************************************
* APPLICATION: _2_03b
* MODULE: main
* PURPOSE:
* AUTHOR(S): damian.galczynski
*
* 5/11/2017 4:25:24 PM Created.
*****************************************************************************/
#include <stdio.h>
#include <Windows.h>
#include "auxfunctions.h"
/*****************************************************************************
* THE MAIN ENTRY POINT TO THE PROGRAM.
*
* input: argc The number of arguments of the programme.
* argv The vector of arguments of the programme.
* return: The code of the reason the process was terminated for.
* The value defaults to zero.
*****************************************************************************/
DWORD WINAPI threadA(void* params);
int main(int argc, char* argv[])
{
HANDLE WINAPI hThread;
DWORD tid = GetCurrentThreadId();
hThread = CreateThread(NULL, 0, threadA, NULL, 0, &tid);
if (hThread)
{
printf("Press any key to stop ...\n");
getchar();
CloseHandle(hThread);
}
return 0;
}
DWORD WINAPI threadA(void* params) {
const DWORD pid = GetCurrentProcessId();
const DWORD tid = GetCurrentThreadId();
const DWORD timeDeley = getDelayTime();
DWORD exitCode;
int timeRemain;
randomize();
timeRemain = getRunningTime(THRT_MIN, THRT_MAX);
printf("(EXE-2.03b)Watek A : %05lu:%05lu: Watek wystartowal. \n", pid, tid);
printf(" Opoznienie: %d\n", timeDeley);
printf(" Czas Startu: %d\n", timeRemain);
do {
printf("(EXE-2.03b)Watek A : %05lu:%05lu: %d\n", pid, tid, timeRemain);
Sleep(timeDeley);
timeRemain = timeRemain - timeDeley;
} while (timeRemain > 0);
exitCode = makeCode();
printf("(EXE-2.03B)Watek A : %05lu:%05lu: Code: %lu""\n", pid, tid, exitCode);
return exitCode;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}