The call itself is thread safe, but practice is not. Whenever you free a resource whose identifier can be reused after it is released, you must synchronize with all threads that could use it. Otherwise, it is possible that after releasing the resource, a new resource (in your case, a socket) can be allocated with the same identifier (socket number), and the code intended to access the (now closed) server socket may end on another socket.
The extent to which it is dangerous (and whether it can even happen) depends on your code. This may not happen if you do not create more sockets after closing the server socket. But this is still conceptually very wrong, and any competent review of your code will consider it very bad.
: - ( ) - (rwlock). ( , ) , , , , . ( , -1 , ) .