Is adding an element to a list thread-safe?

Hi,

I have a class that has a std::list member. I have a member function that adds a new element to this list. I wonder if pushing back an element to a std::list is thread-safe of should I use mutexes to make the operation thread-safe ?

Thanks.
It is not thread safe. Only atomic operations are threadsafe.

Use mutexes.
(additional info: no STL container is thread-safe).

Topic archived. No new replies allowed.