that's true i was thinking that was the problem but when i didn't use the loop the program shut down. also i've started from the example in the allegro wiki again. my only question now is:
I want to use the main thread for drawing everything, and use the (child) thread for loading everything files,bitmaps etc. now the only problem is that it isn't possible to load bitmaps in a thread except the thread where the display is created?
EDIT: nvm i was able to load them in the other thread thanks anyway!.
EDIT2: When i try to load a map file (without multithreading) the program freezes for a few seconds, now i try to load the file in the second thread now the second thread freezes but the main thread also freezes. any ideas why? although when i use the al_rest(); function in the thread it doesn't slow down the main thread.
EDIT3: I was able to fix it by not using the al_lock_mutex (and unlock) in the main thread ( i didn't need it anyway for updating the values)