What happens if a Task tries to take a semaphore it has already obtained

May be because the software was originally written for another RTOS that had a naming mísmatch and overused semaphores. Kadak’s AMX was such a case; they had two different kinds of semaphores (one called resource semaphores, the other counting semaphores) one of which was really a mutex. Nomenclature in synchronization is historically weird.