Perform some code cleanup

This commit is contained in:
Justine Tunney 2022-06-23 10:21:07 -07:00
parent 0dd9629562
commit a4601a24d3
63 changed files with 350 additions and 1643 deletions

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/intrin/pthread.h"
#include "libc/str/str.h"
@ -24,6 +25,12 @@
* @return 0 on success, or error number on failure
*/
int pthread_mutex_destroy(pthread_mutex_t *mutex) {
int rc;
if (!mutex->lock && !mutex->waits) {
rc = 0;
} else {
rc = EDEADLK;
}
bzero(mutex, sizeof(*mutex));
return 0;
}