clone() for producer and consumer with warning