<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def threadsafe_generator(generator_func):
 """A decorator that takes a generator function and makes it thread-safe. """

    def decoration(*args, **keyword_args):
        """A thread-safe decoration for a generator function."""
        return ThreadSafeIter(generator_func(*args, **keyword_args))
    return decoration