if you don't want to use a separate thread then you can modify your code like following
time_out=SOME_TIME_OUT_VALUE;
while((time_out-- > 0) && (receivebyte == null));
Note that this doesn't guarantee that you will timeout at a specific time (you'd probably want to use a time check for that). Rather, it simply states that you will timeout after a particular loop count is reached.