when thread1 unlock mutex1, which thread will be woken up?
One of the other threads that are currently blocked on the mutex. It is unspecified which of them.
Is there a standard specification for it?
No. Different systems may implement it in different ways. (Some might use a simple fifo order for waking the threads, others might use heuristics for deciding which thread to wake up).