- #define __THREADS_MAIN
- #include <thread.h>
- #include <string>
- extern "C" {
- # include <unistd.h>
- };
- main()
- {
- cond t_control(attributes::process_shared);
- mutex t_link(attributes::process_shared);
- char *buf = (char *)pthread::shalloc(80);
- t_link.lock();
- cout << "Enter text for consumer: ";
- cout.flush();
- cin.getline(buf,80);
- t_control.signal();
- t_link.unlock();
- }