summaryrefslogtreecommitdiffstats
path: root/vcl/headless
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-01-24 22:36:25 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-01-24 22:37:09 +0000
commit7dbd2a0a6d983bdd14bf7a022c0199fde76e143a (patch)
tree596445014cd566d22e933af4832c77d2b6a00e47 /vcl/headless
parentandroid: rename native_app_glue.h and install as osl/detail/android.h (diff)
downloadcore-7dbd2a0a6d983bdd14bf7a022c0199fde76e143a.tar.gz
core-7dbd2a0a6d983bdd14bf7a022c0199fde76e143a.zip
android: re-factor headless a little, and start on the mainloop
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpinst.cxx45
1 files changed, 26 insertions, 19 deletions
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 9de3f8259968..56ea818af6bc 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -325,25 +325,32 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
else
nTimeoutMS = -1; // wait until something happens
- // release yield mutex
- nAcquireCount = ReleaseYieldMutex();
- // poll
- struct pollfd aPoll;
- aPoll.fd = m_pTimeoutFDS[0];
- aPoll.events = POLLIN;
- aPoll.revents = 0;
- poll( &aPoll, 1, nTimeoutMS );
-
- // acquire yield mutex again
- AcquireYieldMutex( nAcquireCount );
-
- // clean up pipe
- if( (aPoll.revents & POLLIN) != 0 )
- {
- int buffer;
- while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0)
- continue;
- }
+ DoReleaseYield(nTimeoutMS);
+ }
+}
+
+void SvpSalInstance::DoReleaseYield( int nTimeoutMS )
+{
+ // poll
+ struct pollfd aPoll;
+ aPoll.fd = m_pTimeoutFDS[0];
+ aPoll.events = POLLIN;
+ aPoll.revents = 0;
+
+ // release yield mutex
+ sal_uLong nAcquireCount = ReleaseYieldMutex();
+
+ poll( &aPoll, 1, nTimeoutMS );
+
+ // acquire yield mutex again
+ AcquireYieldMutex( nAcquireCount );
+
+ // clean up pipe
+ if( (aPoll.revents & POLLIN) != 0 )
+ {
+ int buffer;
+ while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0)
+ continue;
}
}