C | Minimal code
\ntypedef struct {\n    // User defined data is declared here.\n    // using \'volatile\' to prevent compiler from playing god and optimize out this critical va
```\ntypedef struct {\n    // User defined data is declared here.\n    // using \'volatile\' to prevent compiler from playing god and optimize out this critical variable\n    // this is mutex variable, duh \n    volatile int turn;\n} Foo;\n\nvoid wait(Foo* obj, int my_turn) {\n    // blocking this thread till my turn\n    while(obj->turn != my_turn) pthread_yield(NULL); // Nope Gotta wait \uFF08\u25DE\u2038\u25DF\uFF09\n    \n    // Aha!! free at last guess I will return now\n}\n\nvoid signal(Foo* obj) {\n    ++obj->turn; // pass it to next in line (psst: for the future generations)\n}\n\nFoo* fooCreate() {\n    Foo* obj = (Foo*) malloc(sizeof(Foo));\n    // Initialize user defined data here.\n    obj->turn = 1; // first will be executed first, lol \n    return obj;\n}\n\nvoid first(Foo* obj) {\n    printFirst();\n    signal(obj); // I am done please pass ownership of mutex to next in line ( \u0361\xB0 \u035C\u0296 \u0361\xB0) \n}\n\nvoid second(Foo* obj) {\n    wait(obj, 2); // Ok I will wait till my (2) turn (\u2565\uFE4F\u2565)\n    printSecond();\n    signal(obj); // I am done please pass ownership of mutex to next in line ( \u0361\xB0 \u035C\u0296 \u0361\xB0) \n}\n\nvoid third(Foo* obj) {\n    wait(obj, 3); // Ok I will wait till my (3) turn (\u2565\uFE4F\u2565)\n    printThird(); \n    // Oh! no one else left to signal, I guess this ends with me now, *sigh* \uFF08\u25DE\u2038\u25DF\uFF09\n}\n\nvoid fooFree(Foo* obj) {\n    // I am a responsible citizen I clean up after me \n    free(obj);\n}\n```
['C']