Skip to content

Conversation

@mksteve
Copy link

@mksteve mksteve commented Jul 23, 2017

A fix for automutex in NetworkAdapterList::HandleInterfaceListChanged

and the CMake files I needed to build ohNet for Android using windows as my OS.

#define LOGT(x,...)
#define LOG2(x,y,...)
#define LOG2F(x,y,...)
#define LOG3(x,y,z,...)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing, and failed to compile when logging was disabled.

${SourcesMain} )


add_custom_target( IncludeCopy )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code section is to duplicate the header file copying in standard build. Unfortunately ninja generator in windows generated massive lines, so I added the lines in chunks which didn't cause windows to barf. Unfortunately ugly

target_include_directories( ohNet SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/Temp )
set( GENERATED_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/Temp PARENT_SCOPE )
target_include_directories( ohNet SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/ohNet/OpenHome/Net/Bindings/Android/jni )
if( ANDROID_ENDIAN )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the value here, as android is completely little endian - though mostly by convention, not by edict

void NetworkAdapterList::HandleInterfaceListChanged()
{
static const char* kRemovedAdapterCookie = "RemovedAdapter";
iListLock.Wait();
Copy link
Author

@mksteve mksteve Jul 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wait wasn't unwound, if the code to detect the network threw. That left a mutex held by a non-existant thread.

The change here is to use autoMutex, but some variables and scopes had to be moved around to get it to work.

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.

1 participant