Print Zero Even Odd solution in C using mutexes alone
\ntypedef struct {\n    int n;\n    int cur;\n    pthread_mutex_t m_zero;\n    pthread_mutex_t m_even;\n    pthread_mutex_t m_odd;\n} ZeroEvenOdd;\n\nZeroEvenOd
```\ntypedef struct {\n    int n;\n    int cur;\n    pthread_mutex_t m_zero;\n    pthread_mutex_t m_even;\n    pthread_mutex_t m_odd;\n} ZeroEvenOdd;\n\nZeroEvenOdd* zeroEvenOddCreate(int n) {\n    ZeroEvenOdd* obj = (ZeroEvenOdd*) malloc(sizeof(ZeroEvenOdd));\n    obj->n = n;\n    obj->cur = 0;\n    \n    pthread_mutex_init(&obj->m_zero, NULL);\n    pthread_mutex_init(&obj->m_even, NULL);\n    pthread_mutex_init(&obj->m_odd, NULL);\n    \n    pthread_mutex_lock(&obj->m_zero);\n    pthread_mutex_lock(&obj->m_even);\n    pthread_mutex_lock(&obj->m_odd);\n    \n    return obj;\n}\n\n// You may call global function `void printNumber(int x)`\n// to output "x", where x is an integer.\n\nvoid zero(ZeroEvenOdd* obj) {\n    \n    do {\n        printNumber(0);\n\n        if ((obj->cur+1) % 2 == 0)\n            pthread_mutex_unlock(&obj->m_even);\n        else\n            pthread_mutex_unlock(&obj->m_odd);\n        \n        pthread_mutex_lock(&obj->m_zero);\n    } while (obj->cur < obj->n);\n    \n    obj->cur = obj->n + 1;\n    // unlock the last waiter\n    pthread_mutex_unlock(&obj->m_even);\n    pthread_mutex_unlock(&obj->m_odd);\n}\n\nvoid even(ZeroEvenOdd* obj) {\n    while (obj->cur <= obj->n) {\n        pthread_mutex_lock(&obj->m_even);\n        if (obj->cur == obj->n + 1) {\n            pthread_mutex_unlock(&obj->m_even);\n            break;\n        }\n        \n        printNumber(++obj->cur);\n        pthread_mutex_unlock(&obj->m_zero);\n    }\n}\n\nvoid odd(ZeroEvenOdd* obj) {\n    while (obj->cur <= obj->n) {\n        pthread_mutex_lock(&obj->m_odd);\n        if (obj->cur == obj->n + 1) {\n            pthread_mutex_unlock(&obj->m_odd);\n            break;\n        }\n        printNumber(++obj->cur);\n        pthread_mutex_unlock(&obj->m_zero);\n    }\n}\n\nvoid zeroEvenOddFree(ZeroEvenOdd* obj) {\n    pthread_mutex_destroy(&obj->m_zero);\n    pthread_mutex_destroy(&obj->m_even);\n    pthread_mutex_destroy(&obj->m_odd);\n    \n    free(obj);\n}\n```
['C']