Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usd] zipFile: add missing #include <mutex> #2152

Merged

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Jan 9, 2023

Description of Change(s)

This only seems to become an issue on certain compiler / operating systems, but on Ubuntu 22.04.1 LTS with gcc 11.3.0, you get:

/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp: In member function ‘pxrInternal_v0_23__pxrReserved__::UsdZipFile::Iterator pxrInternal_v0_23__pxrReserved__::UsdZipFile::_Impl::CachedBegin()’:
/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp:507:14: error: ‘unique_lock’ is not a member of ‘std’
  507 |         std::unique_lock<std::shared_timed_mutex> l(_rwMutex);
      |              ^~~~~~~~~~~
/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp:43:1: note: ‘std::unique_lock’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
   42 | #include <unordered_map>
  +++ |+#include <mutex>
   43 |

Adding the #include <mutex> as suggested fixes the issue.

Fixes Issue(s)

  • Error compiling on Ubuntu 22.04 w/ gcc-11.3.0

  • I have verified that all unit tests pass with the proposed changes

  • I have submitted a signed Contributor License Agreement

This only seems to become an issue on certain compiler / operating
systems, but on Ubuntu 22.04.1 LTS with gcc 11.3.0, you get:

```
/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp: In member function ‘pxrInternal_v0_23__pxrReserved__::UsdZipFile::Iterator pxrInternal_v0_23__pxrReserved__::UsdZipFile::_Impl::CachedBegin()’:
/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp:507:14: error: ‘unique_lock’ is not a member of ‘std’
  507 |         std::unique_lock<std::shared_timed_mutex> l(_rwMutex);
      |              ^~~~~~~~~~~
/Projects/Dev/USD/USD/pxr/usd/usd/zipFile.cpp:43:1: note: ‘std::unique_lock’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
   42 | #include <unordered_map>
  +++ |+#include <mutex>
   43 |
```

Adding the `#include <mutex>` as suggested fixes the issue.
@sunyab
Copy link
Contributor

sunyab commented Jan 9, 2023

Filed as internal issue #USD-7855

@pixar-oss pixar-oss merged commit 1b3e6bd into PixarAnimationStudios:dev Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants